[PLUG] Script not working as intended

Rich Shepard rshepard at appl-ecosys.com
Sun Dec 15 14:22:00 UTC 2019


Yesterday I put this command in root's crontab:

# remove all files in /tmp not modified in 7 days daily at 1:20
20 1 * * * find /tmp -mtime +7 -type f -exec rm -f { } ';'

It is not working as I expected since there are files in /tmp as old as last
August. There are also old directories not modified for months.

Should I put this in a shell script and use 'test' first? Would the old
subdirectories removal be fixed by changing the rm option to -rf without
adversely affecting the results?

Regards,

Rich



More information about the PLUG mailing list