Making xen images from tar files means I get to work with large files. Sometimes I need to poke inside those files before they are made into a disk image. I found that tar on Debian lenny does not have the --occurrence keyword for stopping after the n’th occurrence of a file in the image. tar on Debian squeeze has that keyword. Unfortunately there is no tar in backports, so I get to build the tar sources from squeeze (1.23) on lenny.

I need this because I have stored some parameters into the tarfile for quick extraction at restore time. I made sure to put that file early in the tarfile, but because tar on lenny doesn’t understand the --occurrence=1 parameter it still takes something like 5 or 10 minutes to read through the whole file before moving on to the next step. That’s just a tad painful when developing and testing restore scripts.

For reference:

  • tar on Debian lenny: 1.20-1+lenny1
  • tar on Debian squeeze: 1.23-3

    bjb$ tar --help | egrep occur
          --occurrence[=NUMBER]  process only the NUMBERth occurrence of each file
    bjb$