[TriLUG] `find -delete` not deleting

Alan Porter via TriLUG trilug at trilug.org
Tue Sep 6 13:36:42 EDT 2016


> Why are you using find? Your directories are already named for
> datestamps. Just have the cron job's shellscript calculate 7 days
> ago (let's say 8/27/2016), then do rm -rf whatever/20160827.

Like this....

lastweek=$(date -d "-7 days" +%y%m%d)

or

rm -rf whatever/$(date -d "-7 days" +%y%m%d)

Alan




More information about the TriLUG mailing list