Skip to content

Instantly share code, notes, and snippets.

@speedmax
Created August 14, 2009 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save speedmax/167686 to your computer and use it in GitHub Desktop.
Save speedmax/167686 to your computer and use it in GitHub Desktop.
app:sync - local and production synchronization
# app:sync
# Local and production synchronization
# - require yaml_db plugin
namespace :app
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