Skip to content

Instantly share code, notes, and snippets.

@vitaly
Created September 6, 2012 09:40
Show Gist options
  • Save vitaly/3653903 to your computer and use it in GitHub Desktop.
Save vitaly/3653903 to your computer and use it in GitHub Desktop.
safe do
local :path => "backup/:kind"
tar do
archive "a1", :files => "some-directory-to-backup"
end
end
require "fileutils"
exit unless from = Dir['backup/archive/archive-a1*'][0]
puts "from: #{from}"
to = "backup/archive/#{Date.today}-#{File.basename from}"
puts "to: #{to}"
FileUtils.mv from, to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment