You are not logged in.
Pages: 1
I'm running hdup for backups and since I don't have a need for 31 daily backups plus 4 weekly backups and a monthly backup, I have cron jobs set up to delete them after a given period of time and that's working well. The problem is the cron job I have set up to delete the folders those backups are in isn't working. I found this command online somewhere:
30 03 * * * find /backup/directory/ -mtime +7 -depth -type d -print0 -mindepth 1 | xargs --no-run-if-empty --null rmdir
and it's not working because I keep getting this error message in my logs: rmdir: failed to remove `/backup/directory/2008-07-30': Directory not empty.
The weird thing is it's only trying to delete the 2008-07-30 folder (it currently holds a monthly backup) and no others. I'm no cron-master so how do I set up a command to search for empty folders older than 7 days and delete them?
Last edited by k_odoma (2008-08-30 06:43:54)
Offline
Pages: 1