[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-tar] tar | gzip problems
From: |
cooch17 |
Subject: |
Re: [Help-tar] tar | gzip problems |
Date: |
Fri, 25 Sep 2009 13:09:19 -0700 (PDT) |
Piotr Szlązak wrote:
>
> Hi!
> Try using gzip -c:
> nohup tar cvpf - . | gzip -9 -c > /directory/of/interest/files.tar.gz &
>
> Regards,
> Piotrek
>
>
>
>
>
>
I ended up going with tar -cvpzf files.tar.gz *
which does the trick without any problems. I got a long answer on why my
original code didn't work:
'piping' was never the problem. The command below (tar cz...) also
uses pipes (you just don't see/type them).
The problem is taring up files (compressed or not) to a tarball *in the
same directory* as the files you are taring up and using '.' as your
source. Using a '*' (shell wildcard) 'avoids' the problem, but adds
others (missed hidden files, etc.) -- it is *often* a mistake to use
shell wildcards with commands like tar (esp. a bare '*'). The proper
solution is either:
A) put your tarball someplace other than where you are tarring up:
tar czvf /tmp/files.tar.gz .
B) use the --exclude option to exclude the tarball being created:
tar czvf files.tar.gz . --exclude files.tar.gz
--
View this message in context:
http://www.nabble.com/tar-%7C-gzip-problems-tp25612830p25618482.html
Sent from the Gnu - Tar - Help mailing list archive at Nabble.com.