On Sun, 2004-01-25 at 00:31, Justin Findlay wrote:

> Also `man' and `info' are your friends.
> 
> Here is a more complicated syntax that lets you pass options to the compressor you 
> use for your tar file:
> 
> tar cf - ~ | bzip2 -9v > /tmp/backup.tar.bz2
> 
>   OR
> 
> tar cf - ~ | gzip -9v > /tmp/backup.tar.gz

Even more cool are things like:

tar cf - ~ | gzip -9v | ssh -l torriem isengard 'cat >
/tmp/backup.tar.gz'

or

tar -czfp - ~ | ssh -l torriem isengard 'cd /home ; tar -xvzf -'

or

ssh -l torriem isengard 'cd /home ; tar -czfp - torriem' | ( cd /backup
; tar -xvzf - )
 
or just use rsync.  :)

One reason to use tar across ssh to copy things, rather than scp, is
that tar can preserve permission and symbolic links, whereas scp will
dereference symlinks.

Even for those that don't consider themselves to by system
administrators, the book "Linux Server Hacks" from O'Reilly is a really
cool book with a lot of these tricks.

> bzip2 gives better compression.  There is no reason to use gzip when you know bzip2 
> will be available, and <yawn> compress is still patented.  No need to apply 
> forbidden voodoo if you don't have to.

Besides the quality of compression, it's the speed of compression where
gzip is significantly faster than bzip2.  In my experience, though,
bunzipping a file is about the same as gunzipping a file.

Michael


> 
> 
> Justin
> 
> _______________________________________________
> newbies mailing list
> [EMAIL PROTECTED]
> http://phantom.byu.edu/cgi-bin/mailman/listinfo/newbies
-- 
Michael Torrie <[EMAIL PROTECTED]>

_______________________________________________
newbies mailing list
[EMAIL PROTECTED]
http://phantom.byu.edu/cgi-bin/mailman/listinfo/newbies

Reply via email to