Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I came across this shell script that can be used to split an entire directory across multiple compressed files.

I am interested in making a minor tweak to this script. Lets say I have n GB of files in a directory. I do not want the contents of a particular folder to be split across multiple tar files but inside the same file. I want the n MB folder to be fit within a single compressed file and the remaining (n GB -n MB) split across multiple files.

I am not sure whether it is possible with this script. I was looking forward to some suggestions. Though the script has been well documented, it is quite complex to understand for me

share|improve this question
Perhaps you could use a strategy that involves handling the special cases you mentioned separately and then running the script on the rest of the files. This would take the form of some type of filter in the shell script to ignore 'special case' folders and should be a minor change to `emit_dir_parts*. – Alex Hirzel Jun 25 '12 at 19:28
Thanks it helped :) – Sai Jun 27 '12 at 2:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.