Web Hosting Talk







View Full Version : Cpanel Simpre Cron job


webstyler
02-14-2004, 04:38 AM
hi

I have this :

find /home/mysite/public_html/download -type d -cmin +20 -exec rm -rf {} \;

This beacause I want delete all dir and files "INTO" dir download that is old more 20 minutes

BUT the problem is that this delete also dir download ??

:(

why ?

thks

willfe2
02-14-2004, 05:06 AM
Try this:

cd /home/mysite/public_html/download/ ; find . -type d cmin +20 -exec rm -Rf {} \;

This sets the working directory to .../download/, so find won't include it in the list of items to purge.

webstyler
02-14-2004, 06:45 AM
ok

the dir INTO download is delete

thks

BUT I receive this email message

============================
rm: cannot remove `.' or `..'
find: ./test2: No such file or directory
============================

?