For mysql, in cron I run this command:
Code:
/usr/bin/mysqldump -u mythtv -pmythtv mythconverg -c | /bin/gzip -9 > /everything/Backup/teak/mythtv_backup-$(date '+\%a').sql.gz
The date thing basically writes to files with the day in the name:
Code:
mythtv_backup-Tue.sql.gz
mythtv_backup-Mon.sql.gz
mythtv_backup-Sun.sql.gz
mythtv_backup-Fri.sql.gz
mythtv_backup-Thu.sql.gz
mythtv_backup-Wed.sql.gz
mythtv_backup-Sat.sql.gz
So this overwrites after a week.
Whilst I'm at it... for rsback I do this:
Code:
0 2 * * 1-7 /everything/net/bin/rsback -v work-daily >>/var/log/rsback/work-daily.log
0 4 * * 6 /everything/net/bin/rsback -v work-weekly >>/var/log/rsback/work-weekly.log
0 5 1 * * /everything/net/bin/rsback -v work-monthly >>/var/log/rsback/work-monthly.log
Then the config file contains:
Code:
tasks = work-daily \
work-weekly \
work-monthly
and
Code:
[work-daily]
mode = rsync
source = /space/
destination = /space-backup
rotate = daily 7
lock = work-weekly work-monthly
# if_locked_retry = 3 30min
[work-weekly]
mode = link
source = /space-backup/daily.0
destination = /space-backup
rotate = weekly 12
lock = work-daily work-monthly
[work-monthly]
mode = link
source = /space-backup/weekly.0
destination = /space-backup
rotate = monthly 6
lock = work-daily work-weekly
I'll let you judge whether this looks suitable for you - I think it's pretty straightforward
