diff options
| author | mo khan <mo@mokhan.ca> | 2013-11-10 09:16:23 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2013-11-10 09:16:23 -0700 |
| commit | c9a5d761202ad3d39b61e2c6a356d5a332a79a84 (patch) | |
| tree | b37a7ce4ec99c1a58343519ff3fb130299b93300 /lib/tasks/database.rake | |
| parent | 155200dd6a1f1579a5c21fa843ead0aafea31b29 (diff) | |
fix postgres backup task.
Diffstat (limited to 'lib/tasks/database.rake')
| -rw-r--r-- | lib/tasks/database.rake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake index 61c3914c..c2f10bc0 100644 --- a/lib/tasks/database.rake +++ b/lib/tasks/database.rake @@ -9,8 +9,9 @@ namespace :db do end task :backup do - sh "cap production postgresql:backup" - sh "rm -f latest && ln -s db/backups/`ls -rt db/backups/ | tail -n1` latest" + puts "Please specify RAILS_ENV:"; return unless ENV['RAILS_ENV'] + puts "backup up #{ENV['RAILS_ENV']}" + sh "cap #{ENV['RAILS_ENV']} postgresql:backup" end task :restore_to_staging => :backup do |
