Skip to content

Instantly share code, notes, and snippets.

@shuber
Forked from speedmax/sync.rake
Created October 3, 2009 21:01
Show Gist options
  • Save shuber/200881 to your computer and use it in GitHub Desktop.
Save shuber/200881 to your computer and use it in GitHub Desktop.
sync files with a rake task
# 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