Friday, 13 January 2012

How to delete files periodically usign cron.

Hi All,

Please use the following line to delete files:

find /var/www/archive/dbbackup/ -type f -name '*.sql.gz' -mtime +1 -exec rm {} \;

-mtime +1 means all files older more then 1 day.

Thanks
Cheers!

No comments:

Post a Comment