Help with tar

I'm a total Unix dummy, but I hope someone can understand and help me out. I am moving my website from one host to another and I need to preserve the symbolic links I've created.

On my old host, I used tar to create an archive of each year's worth of photos (it's a photography site). I did this for my 2001 photos:

tar cpvhf snapshots2001.tgz 2001/*

Then I logged into the shell on my new host and tried both:

tar xvzf snapshots2001.tgz

and

tar -xvzf snapshots2001.tgz

(because I'm not sure which is correct)

But all I get is an error:

"gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors" :mad:

What am I doing wrong? Is there two different kind of "tars" on my different hosts? If so, how do I determine which one each uses and is there a way to find a method so I can accomplish what I am trying to do?

Like I said, I'm a total dummy here, so please type slowly for me. :slight_smile:

I appreciate any help you can provide!!!!

Thank you!
Nicole

The following command
tar xvzf snapshots2001.tgz
will work with GNU tar to gunzip and then untar a compressed tar file.

However.... when you tar'd the file, you used the command
tar cpvhf snapshots2001.tgz 2001/*

This will not use gzip compression (no z option passed) - if you'd wanted that (and the version of tar on the server supports it), you should have used
tar czpvhf snapshots2001.tgz 2001/*

Even though your current tar file has a .tgz extension, it isn't gzipped, so just try to untar it using the command
tar xvf snapshots2001.tgz

or else, re-tar with gzip compression and upload the file again.

Hope this helps
ZB

Zazzybob - Thank you for the info; it now works. I appreciate the help!

Nicole