Skip to content

Instantly share code, notes, and snippets.

@zunda
Created August 27, 2009 20:40
Show Gist options
  • Save zunda/176544 to your computer and use it in GitHub Desktop.
Save zunda/176544 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
ARGV.each do |src|
if src.scan(/([0-9]{2,2})([0-9]{2,2})([0-9]{2,2})/)
yy = $1
mm = $2
dd = $2
dst = "/mnt/tmp/Archive/Photo#{yy}/#{yy}#{mm}/#{File.basename(src)}"
dstd = File.dirname(dst)
puts "mkdir -p #{dstd}"
puts "cp -a #{src} #{dst}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment