Hi,
CRON jobs are not my expertise, so will appreciate some help from the experts here:
Here is the example directory structure:
/
file 1 and file 2<<-- DO NOT DELETE
DIR-A (file 3 and file 4) <<-- DELETE
DIR-B (file 5 and file 6) <<-- DO NOT DELETE
DIR-C (file 7 and file 8) <<-- DELETE
DIR-D (file 9 and file 10) <<-- DELETE
and so on……. <<-- DELETE
Basically I want a Cron job to delete all files in sub directories (DIR-A, DIR-C, DIR-D and so on) that are older than 7 days but skip one particular folder (e.g. DIR-B) and not delete any files in that folder regardless of how old they are.
Before coming to Jodohost, I had the following command working fine at another host Hsphere crob tab:
find . -mindepth 2 -name DIR-B -prune -o -mtime +7 -exec rm -rf {} ;
but it is not working in Jodohost cron tab,
I have a simpler version of the command working(below), but I need a way to skip one particular folder (DIR-B in my example)
find -mindepth 2 -mtime +7 -exec rm -rf {} ;
Any help with the correct command syntax will be greatly appreciated
Thanks,
SM