-
how to TAR up archived logs and then GZIP it together in a single unix command?
hi guys,
I must apologize for raising this qn here as it might not b too relevant...but I am running into space contraints and I am trying to tar my archived logs and then gzip it at one go without running the command twice ?? and restoring the file likewise in a single command??
anyone can help?
many thanks in advance
-
why not just gzip the files, how will tar save you any space?
-
1. tar to stdout and gzip through a pipe
2. setup a named pipe and gzip through it
Jeff Hunter
-
Just to expand on what Jeff has said, I believe the following should work:
Code:
tar cvf - $ORACLE_BASE/admin/$ORACLE_SID/arch/*.arc | gzip > arch.tar.gz
-
yes!! bingo!! that's wat i needed! thanks! )
-
hacketta,
..in the reverse way...how can i gunzip and then untar the *.tar.gz files?? i must admit that I am not too gd at unix command manipulation...
thanks in advance.
-
gunzip "file" | tar xvf -
-
hi davey23uk,
i hv tried ur method...the cmd run w/o any error but the *.tar.gz becomes *.tar after the run w/o untar the *.tar at all...wondering y???
-
hmm, ive used that command lots of time - try guncip -c at the start instead
-
Code:
gunzip < file.tar.gz | tar xvf -
or with GNU tar
Code:
gtar xvzf file.tar.gz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|