rsync as a bakcup tool and the case of rotated logs

Hans-Juergen Beie hjb at pollux.franken.de
Fri Nov 29 18:51:02 EST 2002


Louis-David Mitterrand wrote:

 > Hello,
 >
 > I use rsync (among many other things) as an incremental backup tool.
 > Every night I save /{home,etc,var} from several servers. On one of them
 > we keep 52 weeks of system logs, so each time syslog is rotated all old
 > syslog.x.gz (where x is between 1 and 213) change names. This impacts
 > our backup transfers because the incremental snapshot now has to include
 > all syslog.x.gz files even though only one of them has been added (and
 > one deleted).
 >
 > Now I am a very happy and grateful user of rsync. I was just wondering
 > if there is any way to:
 >
 > 1) have rsync "understand" that file names might have changed, maybe by
 > comparing files through their md5 signature instead of by their name,
 > that way rsync would see that /backup/syslog.198.gz is the same as
 > /var/log/syslog.197.gz and not retransfer it,

As Craig already proposed, rename or copy it. If you are using logrotate 
you can do that in a postrotate job.

 > 2) create hard-links to identical files in
 > --backup-dir=/backup/incremental-2002-11-27 when is detects that
 > /server/sylog.138.gz is the actually the same as
 > /backup/current/syslog.137.gz,

rsback is a frontend to rsync (disclaimer: I'm the author ;-) which 
allows to make rotating backup archives by hard-linking.
See http://www.pollux.franken.de/hjb/rsback

hjb :-?

-- 
Hans-Juergen Beie
Phone: +49 911 396628 / +49 173 3546274
Fax: +49 911 396663
mailto:hjb at pollux.franken.de






More information about the rsync mailing list