Tuesday, November 11, 2014

automatic deletion of files

PB had set up a cron to automatically delete files from a shared folder two weeks after they were put there. But folders were not being deleted. Now, he updated his script.

Earlier it was

/usr/bin/find  /path/to/folder/expires/* -ctime +15 -exec rm -f {}  \;

Updated to

/usr/bin/find  /path/to/folder/expires/* -ctime +15 -exec rm -Rf {}  \;

No comments:

Post a Comment