Answer the question
In order to leave comments, you need to log in
Find folders with a given name, delete old files and empty folders in the found folders?
is it possible to write such a script?
1. find folders named "share folder" in /volume1/public
2. in found folders and their subfolders find files older than 5 days and delete them
3. find empty subfolders in found folders and delete them
Answer the question
In order to leave comments, you need to log in
find - build a directory tree
-regex (set a regular folder)
-mtime +5 (older than 5 days)
-exec pm (run the command to remove matches)
-empty (empty folders)
Actually, everything can be done with one find
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question