I have this very silly and very basic question but I thought better to ask before I start pruning my NAS.
I want to delete all directories in which all files are older than 30 days.
For files I could have done:
find /path/to/files* -mtime +30 -exec rm {} \;
But this would lead to empty folders at some places. So I was thinking to rather delete all folders with -mtime +30
but I am not sure if the mtime
of folder guarantees mtime threshold for it sub folders and files.
Also, if what I am think is right, what would be the command for the same?