how to create tar and compress at the same time
Hi,
I always create the tar then I compress it, as a two steps. How can I do this in one step? Code:
xyz - is a directory which is under /var/log Code:
tar -cvf /home/sam/march27_backup.tar /var/log/xyz |gzip -c |
Hi,
Tar's -z (--gzip) option can do that: Code:
tar -zcvf /home/sam/march27_backup.tgz /var/log/xyz Code:
tar --help Hope this helps. |
tar can handle the compression itself (using external programs). Have a look at the options -j, -z and -Z in the man page, they work for creating and extracting archives (although not necessary for extracting, tar recognizes compression automatically in that case).
|
Thank you so much for the quick answer.
|
You're welcome :)
BTW: Can you put up the [SOLVED] tag. first post -> Thread Tools -> Mark this thread as solved |
All times are GMT -5. The time now is 12:59 AM. |