[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] More stupid questions...SMB and tar



>>>>> "Barrie" == Barrie Bremner <TheEnglishman [at] ecosse.net> writes:

    Barrie>  (a) Mash up whole directories, maintaining structure,
    Barrie> permissions and ownership and then gzip the lot for backup
    Barrie> (preferably without an intermediate tar - so I don`t have
    Barrie> 2 or 3 versions of my data in various stages of
    Barrie> compression on one disk - many, many Gb!!)

tar czf TARFILE.tar.gz DIRECTORY
tar cIf TARFILE.tar.bz2 DIRECTORY

The first is gzip, the second is bzip2, much better compression, but
not as tried and tested as gzip.  I've never heard of anyone losing
data to bzip2, of course.  Unlike zip, tar assumes you want to keep
the directory structure.

If you want to watch the whole process, use `tar cvzf ...' or `tar
cvIf ...'.

    Barrie>  (b) Mash up files into a tar, any old way, as I can dig
    Barrie> the files out again (to fetch a bunch of my files from a
    Barrie> remote server)

    Barrie>  (c) Un-mash everything above back onto my system.

To get files back out, use tar xzf TARFILE.tar.gz (or tar xIf
TARFILE.tar.bz2).  To get individual files, put their names on the
command line.  You must specify the whole path if they are in
subdirectories.  to find out what's in there (in particular, the exact
form of the path), use `tar tzf ...' (`tar tIf ...').

I assume you don't care about special files (stuff like /dev and
probably pipes)?  If you do, you should be a little more careful;
traditional tars can't handle them (implying that GNU tar can, but I
couldn't find a reference in the info manual).  You might want to use
cpio instead, but tar is more convenient.


-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.