4

I'm trying to find a utility or approach out there that will allow me to compress an entire directory into chunks. I know it's easy to specify, for example, that the archive files created should be exactly X size or smaller, but the archive utilities usually make it so you need all the archive files to open the archive, and that's what I'm trying to avoid. I need to be able to specify a maximum size of an archive file and it adds files into it until it's going to run out of space on the next file so it starts a new archive file. That way the archive files are technically independent of each other.

I'm sorry, it's hard for me to put this into words precisely. Please comment if I'm not being specific enough.

2 Answers2

1

Sometimes I am in the same situation, many big files have to be compressed into a few archives. As I also did not found a tool that fit my needs, I take a different approach.

All small (e.g. max 100MB) files get into one archive, the big (e.g. 500MB and bigger) files will be compressed into a single archive each. So I just pipe the contents of the directory into a textfile and convert that into a simple batchfile:

directory:
file1.dat
file2.csv
file3.mdf

script:
zip -9 file1.dat.zip file1.dat
zip -9 file2.csv.zip file2.csv
zip -9 file3.mdf.zip file3.mdf

Its a bit handcrafting, but works for me, hope that helps a bit. ;-)

Phil Swiss
  • 1,437
  • 9
  • 4
0

If you are using GNU tar I believe you can specify -L (tape length, in kilobytes) -- I believe the resulting "tapes" can be untar'd independently.

Not sure how the "change tape" functionality behaves with files (or compression) though, so experiment first :-)

voretaq7
  • 79,879
  • 17
  • 130
  • 214