If someone wants to do this with cronjob, please keep in mind that this is:
find .session/ -atime +7 -exec rm {} \;
very slow having many files.
Consider instead:
find .session/ -atime +7 | xargs -r rm
In case there are spaces in the file names, use this:
find .session/ -atime +7 -print0 | xargs -0 -r rm
xargs populate the command line with files to be deleted, and then run the rm command much smaller -exec rm {} \; which will output the rm command for each file.
Only my two cents
Andi Jan 30 '14 at 8:40 2014-01-30 08:40
source share