Advertisement
Guest User

Clean weekly backups to only keep 1 month

a guest
Aug 30th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.19 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # In the specified folder, find any folders 28 days old and remove them.
  4. # Run once a week via crontab.
  5. find /backup/weekly -maxdepth 1 -type d -mtime +28 -exec rm -r {} \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement