[mythtv-users] Using the mythconverg_backup.pl script (slightly OT)

Bill Bogstad bogstad at pobox.com
Thu Dec 3 15:59:06 UTC 2009

On Wed, Dec 2, 2009 at 10:41 PM, Nick Rout <nick.rout at gmail.com> wrote:
> On Thu, Dec 3, 2009 at 4:35 PM, Harry Devine <lifter89 at comcast.net> wrote:
>> I've been using the mythconverg_backup.pl script in a cron job for a few
>> weeks now.  I have it on a 7 day rotation.  I have another PC in the house
>> that is running plain-jane Ubuntu 9.10 and I want to archive my database
>> backups to that PC.  I have the authorized_keys mechanism working properly
>> between the 2 PCs, but I'm a little unsure of how to get only the latest
>> file over there.
>> What I'd really like to have is the same 7 files on both machines.  But how
>> do I do this?  Do I issue some sort of remote shell command to delete the
>> files on the backup PC then copy over the Myth backup files?  Perhaps create
>> a cron job on the backup PC to cleanup the directory at a time BEFORE the
>> new backups come over?
>> I'm sure I'm over thinking this a little, but I'm open to suggestions.
> rsync --delete -az /home/of/backups/* othermachine:/place/for/them/there/
> --delete will delete from the destination directory anything that is
> not in the source directory so you don't get a big build up in there.

I'm not 100% sure of this, but I don't think that rsync is going to
work any more efficiently then a rcp/scp would for this
purpose.  I'm pretty sure that rsync compares files by names (not
inodes).  The problem is that the file that was foo.3 today
is going to be the file foo.4 tomorrow and from what I have seen (and
a brief google search) rsync pays no attention to
file renames.  So once you have seven backup files it's going to copy
the entire contents of all seven files every day rather then just the
new file.   Now if you were going to run rsync more often then
mythconverg_backup, rsync would only do those seven copies one time
for every file rotation run.   If the logfile naming convention had
been to append the date of the rotation to the base filename and only
keep the N most recent files then rsync would be smart enough to only
copy the new file and delete the oldest file once even if you ran
rsync more often then the rotation schedule.

Bill Bogstad

More information about the mythtv-users mailing list