[mythtv-users] multiple backup directories
Michael T. Dean
mtdean at thirdcontact.com
Wed Feb 23 18:01:43 UTC 2011
On 02/23/2011 11:10 AM, Kevin Johnson wrote:
> Running Mythbuntu trunk here.
> I use the automated cron job that backs up my database to a specified directory.
> It works great. However, I would like to add another location for backups. Redundancy. (I want the data backed up to two different locations at the same time)
> I have a drobo that I would like to use. The directory I would like to use on the drobo is at /media/usb0/backups.
> This is my current backuprc
> DBBackupDirectory=/D2/backups This works fine.
> How can I add the drobo directory to this?
I don't have the backup script set to write duplicate copies of the
backup, at this time. It creates the one copy within the location you
specify, then the rest is (currently) up to you.
So, I would recommend you copy the resulting backup from /D2/backups to
/media/usb0/backups with another script (i.e. have the cron job call a
script, "do_mythtv_backup", which calls mythconverg_backup.pl and then
copies the backup, or whatever). For copying the backup, if you want to
take advantage of the mythconverg_backup.pl script's backup rotation
feature, the easiest approach is to use rsync to "synchronize" the 2
directories. Assuming you have no files other than MythTV backups in
/media/usb0/backups (and /D2/backups):
rsync -n -av --delete /D2/backups/ /media/usb0/backups/
should work. Note, though, that you'll have to remove the -n (dry-run)
argument that will make it simply tell you want it's going to do, then
exit without doing anything. Run it first with the -n to verify it's
not doing bad things--like deleting your non-MythTV system backups that
you didn't realize were in that directory or copying gigabytes of
recordings you didn't realize were in /D2/backups or whatever.
Oh, and I take no responsibility for the results of running the
command--so make sure it will do what you want/test safely. :) (I am
not an rsync expert!)
More information about the mythtv-users