<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Ok thanks Matt,<br><br>Ah. I think I've realised my mistake. I saw this webpage <a href="http://beeznest.wordpress.com/2005/02/03/rsyncable-gzip/">http://beeznest.wordpress.com/2005/02/03/rsyncable-gzip/</a> which showed the following command.<br>&nbsp; GZIP="--rsyncable" tar zcvf toto.tar.gz /toto<br><br>I've just realised that gzip must be picking up the environment variable when it's invoked by tar. Cool.<br><br>So if I understand you correctly you are suggesting that I modify my backup line to be something like this:<br><br>tar czf - --files-from $FILE_LIST | gzip --rsyncable &gt; ${BACKUP_FILE}<br>or:<br>GZIP="--rsyncable" tar cvf - --files-from $FILE_LIST &gt; ${BACKUP_FILE}<br>
<br>then<br>rsync ${BACKUP_FILE} $HOST:${BACKUP_FILE}<br><br>I see that Debian's gzip has --rsycnable available. Hoorah.<br><br>I just tried some tests but didn't get the results I expected. I seem to be getting quite different files:<br><br><br>$ GZIP="--rsyncable" tar zcf m5.tgz ./newdir<br>$ GZIP="--rsyncable" tar zcf m6.tgz ./newdir<br>$ sum -r m[56]*<br>25302&nbsp; 2929 m5.tgz<br>60054&nbsp; 2929 m6.tgz<br>$ cmp m[56]*<br>m5.tgz m6.tgz differ: byte 5, line 1<br><br><br>
I also tried this with the other format:<br>
<br>$ tar cf - ./newdir | gzip --rsyncable &gt; m7.tgz<br>$ tar cf - ./newdir | gzip --rsyncable &gt; m8.tgz<br>$ sum -r m[78]*<br>36275&nbsp; 2929 m7.tgz<br>15148&nbsp; 2929 m8.tgz<br>$ cmp m[78]*<br>m7.tgz m8.tgz differ: byte 5, line 1<br><br><br>I tried this:<br><br>$ tar cf m9.tar ./newdir<br>$ tar cf m10.tar ./newdir<br>$ sum -r m*tar<br>54744&nbsp; 3340 m10.tar<br>54744&nbsp; 3340 m9.tar<br>$ gzip --rsyncable m9.tar<br>$ gzip --rsyncable m10.tar<br>
$ sum -r m*tar<br>21783&nbsp; 2929 m9.tar.gz<br>30175&nbsp; 2929 m10.tar.gz<br><br><br>It seems that gzip produces different output even given the same input. Not very rsync friendly.<br>I did these tests on Debian Lenny v5.0.3 with gzip v1.3.12.<br><br>Have I missed the point?<br><br><br><br><br>I'm not sure I can see what I'd use the rdiff command for since rsync will do the delta-transfer cleverness for me.<br><br>Cheers,<br>Mark<br><br><br>&gt; Subject: RE: rsync of STDIN to a file.<br>&gt; From: matt@mattmccutchen.net<br>&gt; To: mark_young@hotmail.com<br>&gt; CC: rsync@lists.samba.org<br>&gt; Date: Thu, 19 Nov 2009 11:53:30 -0500<br>&gt; <br>&gt; On Thu, 2009-11-19 at 16:28 +0000, Mark Young wrote:<br>&gt; &gt; I tried an experiment to see how rsync coped with the tar compressed<br>&gt; &gt; files versus the uncompressed files. I took a .tgz from last week and<br>&gt; &gt; rsync'd it with last nights version. rsync achieved the transfer with<br>&gt; &gt; a 1.61 speed up. Specifically 172MB of the 262MB file was transferred.<br>&gt; &gt; I then tried the same thing with the uncompressed tar files. rsync<br>&gt; &gt; achieved the transfer with a 690 speed up. Specifically 5MB for the<br>&gt; &gt; 3.6GB file was transferred. Clearly if diskspace were not an issue<br>&gt; &gt; this would be by far the superior option. Obviously I could increase<br>&gt; &gt; the complexity of the overall solution with compress &amp; uncompress jobs<br>&gt; &gt; in sync with the backup strategy, but I believe in keeping it as<br>&gt; &gt; simple as possible when it comes to backups.<br>&gt; <br>&gt; Right.  The gzip --rsyncable option is designed for this case: files<br>&gt; compressed with --rsyncable should delta-transfer almost as well as<br>&gt; uncompressed files, at a minor penalty in the compression ratio.<br>&gt; <br>&gt; &gt; rdiff is a new one on me. Very interesting and something I'll<br>&gt; &gt; experiment with. For our strategy of 7 daily backups and 12 monthly<br>&gt; &gt; backups I guess I'd need to use two rdiff destinations so I could<br>&gt; &gt; apply the --remove-older-than 1W and --remove-older-than 365D options<br>&gt; &gt; respectively. It might not suit my current situation as explained<br>&gt; &gt; above regarding storing a tarball versus a directory hierachy, but<br>&gt; &gt; it's definitely worth knowing about.<br>&gt; <br>&gt; I was talking about rdiff (a command-line interface to the<br>&gt; delta-transfer algorithm), not rdiff-backup (the incremental backup<br>&gt; tool).<br>&gt; <br>&gt; &gt; Also I'd not heard of the --rsyncable option for tar. It's not there<br>&gt; &gt; on my Debian Etch system, nor in my cygwin tar. So I guess it's not in<br>&gt; &gt; common distributions by default. Still it sounds useful and is<br>&gt; &gt; something I will bear in mind as something to consider.<br>&gt; <br>&gt; The option applies to gzip, not tar.  In fact, it looks like Fedora<br>&gt; applies an updated version of the gzip-rsyncable patch to their gzip<br>&gt; package.  You can get their patch from:<br>&gt; <br>&gt; http://cvs.fedoraproject.org/viewvc/rpms/gzip/F-11/gzip-1.3.9-rsync.patch?view=co<br>&gt; <br>&gt; -- <br>&gt; Matt<br>&gt; <br>                                               </body>
</html>