Commit 3494328a6a697b3c671f7b50141c356eede235c1

Authored by Sergio Oliveira
2 parents 3fd1d558 5d1b6a66

Merge branch 'master' of portal.softwarepublico.gov.br:softwarepublico/softwarepublico

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'
... ...