[mythtv-users] A MythTV backup proposal

Richard Freeman r-mythtv at thefreemanclan.net
Sun Apr 6 02:41:34 UTC 2008

David Segall wrote:
> That is why I proposed 
> a backup that weighted the value of the backed up recordings rather than 
> use rsync that treats all the files equally.

Hmm - without actually taking the time to figure out the details:

1.  Run a query against the database to generate a list of files in 
prioritized order.  This isn't hard to do.
2.  Figure out from top to bottom how many of those will fit on the 
backup volume.
3.  Copy them to backup.  Simple solution offhand would be to hard link 
everything into one prep directory and then rsync that to the backup volume.

This gets messier if you have storage groups / etc (you can't just do 
one rsync of one directory of hard links, but you'd need to manually 
delete anything that doesn't stay and then rsync individual files). 
Also - some potentially easier solutions won't work if files that were 
previously backed up drop in relative priority - you can't assume that 
anything that you have backed up that isn't deleted stays backed up.

A simple but IO-intensive solution is to just delete all the backups and 
then recopy them in priority order (and pray for no drive failures 
mid-backup).  The backup will fail when it runs out of space filling up 
as much of the volume as possible.

This isn't a huge task, but it isn't a 3 line shell script either (well, 
not without creative use of semi-colons).

I think that individual needs in this area will vary considerably.  I 
backup my database (and /home, /etc, and some of /var and other dirs) 
and use RAID for everything else, but that's it.  The TV isn't quite 
worth full redundancy.  Basically I'm trading insecurity for dollars - I 
know what I'll lose in a disaster and I'm willing to accept it.  The 
important thing is that you know the risks you are taking and are fine 
with it.

More information about the mythtv-users mailing list