Rsync backup to tar or gzip archive

John Summerfied debian at herakles.homelinux.org
Wed Jan 25 01:04:53 UTC 2006


Julian Underwood wrote:
> Hello List,
> 
> I am wanting to backup my Linux machine at work using Rsync.  I have a
> mounted SMB share which it will be backing up to.  I would like to rsync
> "into" an archive, so the backup is all in one file.  I've done some
> googling and haven't found a real clear way to do an rsync backup into
> either a tar or gzip archive.
> 
> Does anyone have a couple of one-liners or links they could recommend?

rsync is a mirror program. It's purpose is to intelligently synchronise 
(sync) a local and a remote (r) copy of chosen elements of a filesystem.

It is capable of patching destination files to make them the same as 
source files. For this to work reasonably well, the source and 
destination need to be somewhat similar.

An example that works:
Ubuntu, in its test cycle, creates daily builds of its install media. 
Each build contains great gobs of stuff that was the same yesterday, and 
a few things that got rebuilt since yesterday's build.

rsync can intelligently transfer the differences and massage your copy 
into an exact image of the new one, even (I'm told) to the extent of 
recording slabs of the destination.

This would actually work were the ISO actually an uncompressed tarball 
or any other kind of uncompressed archive.

And example that does not work:
(We'll say) Ubuntu creates a daily compressed tarball of the entire 
source tree, and users round the world use rsync to update their local 
copies.

This does not work because the archive is one huge compressed file and 
contains no great chunks of data the same as yesterday's.

It would work, if they ran gzip (or bzip2 or other compression program) 
over the source tree and then created a tarball of that, because then 
there would be big pieces of compressed data in today's archive the same 
as yesterday's.


I have tried, and discussed with the rsync folk, to use rsync to mirror 
the filesystem on a server across an ADSL link. It uses enormous gobs of 
virtual storage (fortunately, in doing so its usage pattern does not 
induce thrashing even when virtual storage is five and more times real) 
and runs for hours; when I was trying to do it, often timing out and 
failing to finish, and on occasion I had it running for days: clearly 
not satisfactory for a daily backup.

What I do now is create an ISO of compressed files (I use mkzftree[1]) 
and I can sync that in under an hour.


1. The resultant ISOs can be burned to DVD (too big for CD), mounted on 
Linux and the individual files read as the kernel transparently 
decompresses them.

For a small filesystem, I'd just rsync the directory structure to 
replicate the filesystem, unless I particularly needed a single-file 
archive.



-- 

Cheers
John

-- spambait
1aaaaaaa at computerdatasafe.com.au  Z1aaaaaaa at computerdatasafe.com.au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/

do not reply off-list




More information about the fedora-list mailing list