Created
April 27, 2012 09:49
-
-
Save cayblood/2507939 to your computer and use it in GitHub Desktop.
backing up something daily, weekly, monthly and yearly with logrotate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# daily backup for 7 days | |
"/file/to/backup.log" { | |
daily | |
copytruncate | |
rotate 7 | |
compress | |
compresscmd /bin/bzip2 | |
compressext .bz2 | |
} | |
# weekly backup for 4 weeks | |
"/file/to/backup.log.7.bz2" { | |
weekly | |
missingok | |
rotate 4 | |
} | |
# monthly backup for 12 months | |
"/file/to/backup.log.7.bz2.4" { | |
monthly | |
missingok | |
rotate 12 | |
} | |
# yearly backup for 10 years | |
"/file/to/backup.log.7.bz2.4.12" { | |
yearly | |
missingok | |
rotate 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment