Skip to content

Instantly share code, notes, and snippets.

@shayfrendt
Forked from speedmax/sync.rake
Created October 8, 2009 05:15
Show Gist options
  • Save shayfrendt/204768 to your computer and use it in GitHub Desktop.
Save shayfrendt/204768 to your computer and use it in GitHub Desktop.
# app:sync
# Local and production synchronization
# - require yaml_db plugin
namespace :app do
namespace :sync do
task :all => [:files, :db]
task :files do
`rsync -azv user@host:'/apps/myawesomeapp/shared/files/' #{Rails.root + 'files'}`
end
task :db do
`cap production invoke TASK="db:data:dump"`
`rsync -azv user@host:'/apps/myawesomeapp/current/db/' #{Rails.root + 'db'}`
Rake::Task["db:data:load"].invoke
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment