Created
August 27, 2009 20:40
-
-
Save zunda/176544 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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