create tar from stdin
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > create tar from stdin




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    create tar from stdin  
Hauke Fuhrmann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-20-06 06:18 PM

Hi there,

anyone has a hint:

I  have an uncompressed tar file and need to get it to a tar.gz.
Looks like tar cannot read from stdin when creating files. is that right?

tar -xvf in.tar --to-stdout | tar czvf out.tar.gz -
tar: -: Cannot stat: No such file or directory

Second try: pipe to gzip:
tar -xvf in.tar --to-stdout | gzip > out.tar.gz

This works, but I cannot untar it:
tar tvzf out.tar.tz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Read 7265 bytes from out.tar.gz
tar: Error exit delayed from previous errors
Return value: 2

What do I do wrong? I need it in this form so that Java can open it,
because it shall be a jar file.

Best regards,
Hauke





[ Post a follow-up to this message ]



    Re: create tar from stdin  
Jerry Peters


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-06 12:21 AM

Hauke Fuhrmann <haf@informatik.uni-kiel.de> wrote:
> Hi there,
>
> anyone has a hint:
>
> I  have an uncompressed tar file and need to get it to a tar.gz.
> Looks like tar cannot read from stdin when creating files. is that right?
>
> tar -xvf in.tar --to-stdout | tar czvf out.tar.gz -
> tar: -: Cannot stat: No such file or directory
>
> Second try: pipe to gzip:
> tar -xvf in.tar --to-stdout | gzip > out.tar.gz
>
> This works, but I cannot untar it:
> tar tvzf out.tar.tz
> tar: This does not look like a tar archive
> tar: Skipping to next header
> tar: Archive contains obsolescent base-64 headers
> tar: Read 7265 bytes from out.tar.gz
> tar: Error exit delayed from previous errors
> Return value: 2
>
> What do I do wrong? I need it in this form so that Java can open it,
> because it shall be a jar file.
>
> Best regards,
> Hauke

You have a tar file already, you don't need to tar it again, just:
gzip in.tar
should create in.tar.gz

Jerry





[ Post a follow-up to this message ]



    Re: create tar from stdin  
Todd H.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-21-06 12:21 AM

Hauke Fuhrmann <haf@informatik.uni-kiel.de> writes:

> Hi there,
>
> anyone has a hint:
>
> I  have an uncompressed tar file and need to get it to a tar.gz.
> Looks like tar cannot read from stdin when creating files. is that right?
>
> tar -xvf in.tar --to-stdout | tar czvf out.tar.gz -
> tar: -: Cannot stat: No such file or directory
>
> Second try: pipe to gzip:
> tar -xvf in.tar --to-stdout | gzip > out.tar.gz
>
> This works, but I cannot untar it:
> tar tvzf out.tar.tz
> tar: This does not look like a tar archive
> tar: Skipping to next header
> tar: Archive contains obsolescent base-64 headers
> tar: Read 7265 bytes from out.tar.gz
> tar: Error exit delayed from previous errors
> Return value: 2
>
> What do I do wrong? I need it in this form so that Java can open it,
> because it shall be a jar file.

You may be overthinking this.  :-)

$ gzip in.tar
$ mv in.tar.gz  in.jar



--
Todd H.
http://www.toddh.net/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:23 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register