I am trying to find solution for next: i need to delete folderx which are not accessed for seven days, easily iI can do it with next:
find /path/folder -type d -mtime +7 |xargs rm -rf
find /path/folder -type d -mtime +7 |xargs rm -rf
But theThe probelm is when iI have subfolder marked for deletion and parent folder is not, iI can do it with with adding maxdepth 1, but actually it is not solution from top to bottom, iI need solution to define from bottom to top where iI have
folder 1 (accesed 8 days ago)
-> folder 2 (accessed 8 days ago)
-> folder 3 (accessed 4 days ago),
folder 1 (accesed 8 days ago)
-> folder 2 (accessed 8 days ago)
-> folder 3 (accessed 4 days ago),
withWith maxdepth 1 it will delete first two and also folder 3 which i dontI don't want do do it. So
So actually iI need some solution from bottom to top for this. If subfolder is marked for deletion and parent is not etc.