D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] rsync to usb disk

 

james kilty wrote:
> On Sat, 2008-08-09 at 12:06 +0100, Robin Cornelius wrote:
> 
>> You could create a tarball of everything first. rsync should *do the
>> right thing* with a binary delta of the tarball and you should still
>> gain lots of transfer efficiency with the added benefit of your
>> filenames/perms being kept well away from FAT32.
> 
> Thanks Robin
> 
> I wanted to take things steadily. I did have instructions to make a
> tarball from some time ago when there was a discussion of rsync.
> 
> So, I tried (in tmp) tar -cvvf docs.tar ~/Documents/ and created the
> file docs.tar successfully. (Does ~/ count as an absolute path? The tree
> in the tar file goes up to and includes home.)
> 

~ should resolve as /home/<you>/ so is an absolute path, just a useful
short cut.

> I also tried tar -cvvf home.tar home/ and this did not work, though it
> went through a huge number of files (what a lot of .thumbnails!). What
> is the correct script?


tar -cf /path/to/tarball.tar /path/to/folders/to/backup/

if you leave of the /path/to on the inital tarball.tar is creates it in
the current directory.

addings v's makes it more verbose


be very careful that you don't create your tarball in the same place you
are trying to back up or you could get a recursive mess. If you are
backing up all of ~ then creating in /tmp seems reasonable.



> 
> Once I can do this, I can zip the file. Then I can rsync it to the usb
> disk.

zip/gzip or bz2, bz2 tends to be slightly smaller but longer encode
time, gzip is the standard linux compression tool (but bz2 is pretty
similar).

> 
> So you are saying that rsync will put the files together properly so it
> can recreate them, however many times I redo the tarball for my backup? 

rsync does binary diffs so i think it md5 sums (or some kind of sums)
chunks of the file and then if different sends the missing info. I'm not
sure how much effect compressing will have wrt the over all delta of the
file. What i mean is that compressing may generate more changes in the
resultant file (even though the over all size is smaller), its probably
worth playing and timing your options.

gzip tarball.tar
bz2 tarball.tar


Robin

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html