So I have to bit of housekeeping for old backups and have the following code working on sh:
find /home/backups -mtime +30 -type f -exec rm -rf {} \;
This works fine as know the location/path, so if the path is diff on another machine how can I modify the command to work on all machines?
If I use the command below that will delete all files 30 days old but I'm only looking to clean up these unique set of backup files only:
find . -mtime +3 -exec rm {} ';'
Thanks
-pruneor-deleteinstead of-exec rm -rf- it's usually a much better option, if yourfindsupports it. – GreyCat Oct 12 '11 at 8:57