Skip to content

Instantly share code, notes, and snippets.

@jasonrobot
Created May 5, 2021 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonrobot/9a97d95b819435610a38d0cdd34c9226 to your computer and use it in GitHub Desktop.
Save jasonrobot/9a97d95b819435610a38d0cdd34c9226 to your computer and use it in GitHub Desktop.
A ruby script to archive a bunch of folders of photos using 7zip
#!/usr/bin/env ruby
require 'date'
index = 1
date = Date.today.to_s
ARGV.each do |dirname|
dirname += '/' unless dirname.end_with? '/'
# puts "7z a #{date}.#{index}.7z #{dirname}*.jpg"
system "7z a #{date}.#{index}.7z #{dirname}*.jpg"
index += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment