Commit 5d1b6a66bb2e471ba245b625d3080e47cc238438
1 parent
a7978199
Exists in
master
and in
83 other branches
Remove backups dir before downloading backups
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
Rakefile
... | ... | @@ -86,8 +86,10 @@ if ['local', 'lxc'].include?($SPB_ENV) |
86 | 86 | end |
87 | 87 | end |
88 | 88 | |
89 | +desc 'Downloads latest system backups to backups directory. WARNING: This overrides anything written in the backups directory' | |
89 | 90 | task :backup => ssh_config_file do |
90 | 91 | # setup |
92 | + sh 'rm', '-rf', 'backups' | |
91 | 93 | sh 'mkdir', '-p', 'backups' |
92 | 94 | # integration |
93 | 95 | sh 'ssh', '-F', ssh_config_file, 'integration', 'sudo', 'chmod a+xr /.snapshots' |
... | ... | @@ -97,6 +99,7 @@ task :backup => ssh_config_file do |
97 | 99 | sh 'scp', '-F', ssh_config_file, 'social:/.snapshots/hourly.0/spb/*', 'backups/' |
98 | 100 | end |
99 | 101 | |
102 | +desc 'Restores content saved in the backups directory to the target env. WARNING: This will drop all the current databases' | |
100 | 103 | task :restore => [ssh_config_file, config_file] do |
101 | 104 | # setup |
102 | 105 | sh 'ssh', '-F', ssh_config_file, 'integration', 'sudo', 'rm -rf /tmp/backups' | ... | ... |