Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/home/jam is my home directory, and backupbox.net is another server on which I have an account that I access via ftp to store the backup, and those "--exclude" directories are just directories I don't want in the backup. Aside from them everything under "/" is supposed to be backed up.
The command does actually create the file server.tar.gz, and sends it to the backup server ok. But if I try to open the archive on the Ubuntu Desktop of the server making the backup, I get this error:
Quote:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
If I run
Code:
tar -tv ./server.tar.gz
on the command line in Terminal to just list the contents of the archive, it just hangs.
Any body can give me a clue what I'm doing wrong? Or is there just a limit to the size of archive that tar can reliably create?
Last edited by just a man; 12-16-2009 at 10:22 AM.
I don't think tar -tv lists files in a .gz archive. Instead use:
tar -ztvf server.tar.gz
(The "z" and "f" inform tar that it is working with a gzip file? Anyway, it should work.)
Your tar command looks OK to me, but I can't see the entire line in the post. (Looks like the words didn't wrap.)
Thanks for the response, if you scroll-bar along to the end it ends "--exclude=/home/jam/stuff /", that is the last exclude, and to archive "/", trying to archive everything else under root except that which is excluded.
I tried your command, and now get a consistent error message, that being the same one as when I try to view the archive via Ubuntu Desktop:
Quote:
sh-4.0$ tar -ztvf server.tar.gz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
sh-4.0$
humour me, and try
tar -zcpf etc. or even
tar -c -z -p -f etc.
Reasons: the '-v' option isn't implemented for making archives, only for extracting; The tar info page (a contender for the most obscure document on the planet) suggests that clustering options is bad news, and they would like if getopt actually threw that out as an invalid format. My guess is they have problems there. The '-z' option is fussy if it's not at the beginning.
I don't think there's an error in your tar command. I created a script like yours and it runs fine. (The "v" causes the list of files being compressed to scroll on the terminal.)
Maybe a corrupt file or directory is throwing tar into a tizzy.
The -z option likes to be near the front of a string of options or it doesn't work.
I don't think -cvpzf is ok, use -cz -pvf or the like
"tar -tz" and "tar -cvpzf" work fine for me.
Code:
% tar --version
tar (GNU tar) 1.22
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.