Unix Technical Forum

packing and compressing in one command call

This is a discussion on packing and compressing in one command call within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> i need help on creating a tar files including compressing in one command call....


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-12-2008, 06:21 AM
Toni Pekas
 
Posts: n/a
Default packing and compressing in one command call

i need help on creating a tar files including compressing in one command
call.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-12-2008, 06:21 AM
Huge
 
Posts: n/a
Default Re: packing and compressing in one command call

"Toni Pekas" <toni.pekas@swisscom.com> writes:
>i need help on creating a tar files including compressing in one command
>call.
>
>


Why?

(Some tar's will create gzip output in one step. I can never remember
which ones, so I always pipe things in and out of compress/gzip.)

--
"The road to Paradise is through Intercourse."
[email me at huge [at] huge [dot] org [dot] uk]


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-12-2008, 06:21 AM
Scott Howard
 
Posts: n/a
Default Re: packing and compressing in one command call

In comp.unix.solaris Toni Pekas <toni.pekas@swisscom.com> wrote:
> i need help on creating a tar files including compressing in one command
> call.


tar cf - dirname | gzip -c > mytar.tar.gz

Scott.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-12-2008, 06:21 AM
Barry Margolin
 
Posts: n/a
Default Re: packing and compressing in one command call

In article <1077101066.641295@ftpgate>,
"Toni Pekas" <toni.pekas@swisscom.com> wrote:

> i need help on creating a tar files including compressing in one command
> call.


If your tar includes the -z option, use it. Otherwise:

tar cf - <filenames> | gzip > archive.tar.gz

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-12-2008, 06:21 AM
Ron
 
Posts: n/a
Default Re: packing and compressing in one command call

"Barry Margolin" <barmar@alum.mit.edu> wrote in message news:barmar->

> tar cf - <filenames> | gzip > archive.tar.gz

tar cf - <filenames> | gzip - >`archive.tar.gz

haven't checked, but the above will work without specifying standard in as
'-'?

Ron


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-12-2008, 06:21 AM
Mikey
 
Posts: n/a
Default Re: packing and compressing in one command call

"Toni Pekas" <toni.pekas@swisscom.com> wrote in message news:<1077101066.641295@ftpgate>...
> i need help on creating a tar files including compressing in one command
> call.


tar cvf - /some/dir | gzip > mytar.tar.gz

or if zip format is acceptable

zip -r9 myzip /some/dir
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-12-2008, 06:21 AM
James Carlson
 
Posts: n/a
Default Re: packing and compressing in one command call

"Ron" <fbr@m-net.arbornet.org> writes:

> "Barry Margolin" <barmar@alum.mit.edu> wrote in message news:barmar->
>
> > tar cf - <filenames> | gzip > archive.tar.gz

> tar cf - <filenames> | gzip - >`archive.tar.gz
>
> haven't checked, but the above will work without specifying standard in as
> '-'?


Yes. gzip (like most UNIX utilities) assumes stdin if you don't give
it a file.

--
James Carlson, IP Systems Group <james.d.carlson@sun.com>
Sun Microsystems / 1 Network Drive 71.234W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.497N Fax +1 781 442 1677
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com