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!

1 comment:


  1. Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
    PHP Database Development in India

    ReplyDelete