tar gzip newbie question

tar gzip newbie question

Post by Morten Ranhei » Mon, 07 Sep 1998 04:00:00




> Hi,

> I need to make a backup of my home directory.

> I don't know the difference between tar and gzip but I wan't everything
> (every file, also in subdirectories) to be zipped into one file.

> how do I write to make this happen assuming that I stand in the root of
> my homedirectory?

To pack your home dir:

tar zcvf foo.tgz /home/foo

To unpack:

tar zxvf foo.tgz

--
Morten Ranheim

 
 
 

tar gzip newbie question

Post by Rob Kom » Mon, 07 Sep 1998 04:00:00


: I need to make a backup of my home directory.
:
: I don't know the difference between tar and gzip but I wan't everything (every
: file, also in subdirectories) to be zipped into one file.
:
tar (stands for `tape archive') is for archiving files, and gzip is for compressing
stuff.  You can use tar to make the single file archive of all you rstuff, and
then use gzip on the archive to compress it.  If you're used to using something
like PKZIP, then you might be surprised to find out that there are programs that
do the steps separately.

: how do I write to make this happen assuming that I stand in the root of my
: homedirectory?

It's easy, so long as you don't try to write the archive into the area you're
archiving.  So, you might write the archive in the /tmp area (or some other
public area that has the space) instead.  You could use the following commands
from inside your home directory:

tar -zcvf /tmp/my_stuff.tar.gz *
mv /tmp/my_stuff.tar.gz .

The `zcvf' stands for: z - gzipped, c - create an archive, v - verbose mode (ie.
show what files are being archived), and f - whatever follows next is the archive
name.  The `mv' command puts the archive into your home area.

Here's some advice that I hope will be even more helpful in the long run.  Look
up this stuff in the documentation (ie., `tar --help', or `man tar', or `info tar',...)
and start getting familiar with these sources of information.  Most of what you'll
need to know to run your system is right on your machine already.  The syntax of
the docs takes some getting used to, but once you learn how to use them, you'll
be most of the way out of the newbie stage.

Cheers,
Robert Komar            Physics Dept., Univ. of British Columbia, Canada
                        (stationed at the Sudbury Neutrino Observatory)
My mail address can be got from the following Unix command:


 
 
 

1. Which is better: tar->gzip or gzip->tar?

For best compression on previously uncompressed files,
which is better: tar * | gzip, or gzip * | tar?
IE, is it best to tar compressed files, or compress
a tar file of uncompressed files?  Does gzip -r * work
better than either solution?

I'm looking for the most robust method to archive groups
of files.

---


Mayo Medical and Graduate Schools        
200 1st St. SW, Rochester, MN 55905

2. Error with Konqueror & Shockwave Flash

3. wu-ftp with enhanced security

4. Newbie tar and gzip questions...

5. Disabling ATAPI retry?

6. Q: gzip/tar uncompress -- newbie question

7. getting debug info

8. newbie using tar and gzip

9. simple tar/gzip question

10. Help with gzip and tar

11. tar and gzip at the same time?

12. gzip and tar