#!/usr/bin/env ruby if ARGV.size < 2 puts "Improper invocation: capistrano-extensions-copy-production-db backup_env restore_env" exit 1 end system("cap local:backup_db RAILS_ENV=#{ARGV[0]}") system("cap remote:restore_db RAILS_ENV=#{ARGV[1]} FROM=#{ARGV[0]}")