Class: DockerComposeDeploy::Actions::Backup
- Inherits:
-
Struct
- Object
- Struct
- DockerComposeDeploy::Actions::Backup
- Defined in:
- lib/docker_compose_deploy/actions/backup.rb
Instance Attribute Summary collapse
-
#shell ⇒ Object
Returns the value of attribute shell.
Instance Method Summary collapse
Instance Attribute Details
#shell ⇒ Object
Returns the value of attribute shell
3 4 5 |
# File 'lib/docker_compose_deploy/actions/backup.rb', line 3 def shell @shell end |
Instance Method Details
#save ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/docker_compose_deploy/actions/backup.rb', line 5 def save shell.notify("Backing up remote ./sites/data directory") shell.notify("This may take a while...") shell.run!("mkdir -p ./backups") shell.ssh!("mkdir -p ./sites/backups") shell.ssh!("tar -zcvf ./sites/backups/#{filename} ./sites/data") shell.scp!("#{connection}:./sites/backups/#{filename}", "./backups/#{filename}") shell.ssh!("rm ./sites/backups/#{filename}") shell.notify "success" end |