Skip to content

Instantly share code, notes, and snippets.

@drichert
Created August 12, 2014 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save drichert/155395aef697b1048867 to your computer and use it in GitHub Desktop.
Save drichert/155395aef697b1048867 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
dir = ARGV[0]
batch_size = ARGV[1] || 100
all_files = Dir.glob("#{dir}/*")
num = 0
all_files.each_slice(batch_size) do |files|
cmd = "zip zip-#{num}.zip #{files.join(" ")}"
`#{cmd}`
num += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment