helpGNU tar - Support: sr #106915, new option to export tar headers...

 
 

sr #106915: new option to export tar headers upon extraction (patch attached)

Submitted by:  None
Submitted on:  Thu 25 Jun 2009 07:58:47 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 1 - WishStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 25 Jun 2009 07:58:47 PM UTC, original submission:

Problem: When extracting files from an archive, one sometimes needs to pipe them to another process as an archive. More specifically, one sometimes requires a subset of an archive, still in the form of an archive.

Example Problem: I have a 300GB archive on a machine called 'server'. I'd like to extract a very small subset of this archive (let's say 100MB) to a machine called 'client'. In this case, ownership and permissions are critical; therefore, temporary extraction onto the file system is impractical (translation: root won't be running the extraction.) Transmitting the entire archive across the network is even more impractical. At present, no standard program can solve this dilemma.

Solution: Patch 'tar' (or on your case, use my patch) to so it can export the headers when it extracts files to standard output. I added the option `--export-headers' (`-Q') to be used in conjunction with `--to-stdout' (`-O'). It will also work with `--to-command'.

Solution to Example: Because I have my new `--export-headers' option, the following allows me to extract a subset of the large archive across the network without any loss of archive information:

> tar -xOQf huge.tar smallfile | ssh me@client tar -x

(Realistically, it's a script on the other end; not 'tar' by itself.)

This simple patch solves what otherwise requires a horrendous solution. I hope you accept it! I'll certainly be using it, either way.
Kevin P. Barry [ta0kira@users.berlios.de]

PS I wrote this today and the diff should be against the most recent 'git' revision.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #18337:  tar-plus-export-headers3.diff added by None (9kB - application/octet-stream - This one handles extended headers. - Kevin P. Barry)
file #18324:  tar-plus-export-headers2.diff added by None (6kB - application/octet-stream - The previous patch didn't handle non-regular files; this one does. Sorry! - Kevin P. Barry)
file #18322:  tar-plus-export-headers.diff added by None (4kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 28 Jun 2009 08:23:52 AM UTCNoneAttached File-=>Added tar-plus-export-headers3.diff, #18337
    Fri 26 Jun 2009 04:56:51 AM UTCNoneAttached File-=>Added tar-plus-export-headers2.diff, #18324
    Thu 25 Jun 2009 07:58:47 PM UTCNoneAttached File-=>Added tar-plus-export-headers.diff, #18322

    Back to the top


    Powered by Savane 3.1-cleanup