> /home/net/stuff has lotsa good files i need to back up. of course, i
> need to leave the contents of /home/net/stuff _intact_ and in place.
> currenly what i do is type "cp -r stuff stuffBkUp"
> what i need to do is to get that same effect, but use compression. that
> is, instead of having directory "stuffBkup" i would like file
> "stuffBkUp.tar" in its place. and then, i would like to be able to
> un-compress "stuffBkUp.tar" of course, which would create directory
> "stuffBkUp." simple, right? ooh, when i uncompress "stuffBkUp.tar" can i
> leave "stuffBkUp.tar" in place? so it would create directory "stuffBkUp"
> and i would still have "stuffBkUp"? (that last part isn't necesary, i
> can just cp the file, i guess)
tar can be kind of confusing. First of all, tar does not compress
anything, unless you tell it to and you have a variant of tar that
can. If you are running Linux then your tar can probably compress
as well as, uh, tar. Just see the tar manpage and look for "compress" .
I've never actually used that option but it looks straightforward enough.
Actually, if it were me I'd use the option for gzip instead of compress.
Anyway, to answer one of your questions, when you create a tar file
it does not delete the files that contribute to the archive, again unless
you tell it to and you have a tar that knows how.
Similarly, when you "untar", the tarfile you are pulling files out of
does not go away or get altered in any way.
To back up your directory:
tar cf /where/you/want/the/tarfile/to/live/stuffBkUp.tar .
(don't forget the trailing '.' )
Where you put stuffBkUp.tar can be anywhere. For sanity, maybe
it is best that it is not under /home/net/stuff .
To restore, try this:
tar xpf /where/you/want/the/tarfile/to/live/stuffBkUp.tar
Note that I haven't specified any compression options - you
can add those later once you've looked at the manpage.
It is good practice to not use absolute paths when specifying
the files to be tarred, like this:
tar cf /some/place/file.tar /my/absolute/path <--- bad
Instead, do something like:
tar cf /some/place/file.tar my/relative/path <--- good
This is because you might want to relocate the files in the
tarfile elsewhere, and using an absolute path when you create
the tarfile complicates matters, and depending on which tar
you are using could even make it impossible to relocate the files.
Hope this helps.
Griff Miller II
Manager of Information Technology
Positron Corporation "I need to be the owner of all of