Skip to content
Snippets Groups Projects
Commit ef051322 authored by Rémi - Le Filament's avatar Rémi - Le Filament
Browse files

[ENH] get db dump and backup in same command

parent bec601a7
Branches master
Tags v1.0.1
No related merge requests found
......@@ -5,8 +5,6 @@ export PGHOST=localhost
export PGPASSWORD={{ cloud_pg_pass }}
export PGUSER={{ cloud_pg_user }}
pg_dump --no-owner --no-privileges --file "/root/backup-$PGDATABASE.sql"
export SWIFT_USERNAME="{{ swift_cloud_username }}"
export SWIFT_PASSWORD="{{ swift_cloud_password }}"
export SWIFT_AUTHURL="{{ swift_cloud_authurl }}"
......@@ -17,6 +15,7 @@ export SWIFT_REGIONNAME="{{ swift_cloud_regionname }}"
export PASSPHRASE="{{ cloud_backup_pass }}"
duplicity full --volsize 200 --include /var/www/owncloud/data --include /var/www/owncloud/config --include /root/backup-$PGDATABASE.sql --exclude '**' / swift://owncloud_{{ inventory_hostname|lower }}
pg_dump --no-owner --no-privileges --file "/root/backup-$PGDATABASE.sql" &&\
duplicity full --volsize 200 --include /var/www/owncloud/data --include /var/www/owncloud/config --include /root/backup-$PGDATABASE.sql --exclude '**' / swift://owncloud_{{ inventory_hostname|lower }} &&\
rm /root/backup-$PGDATABASE.sql
duplicity remove-all-but-n-full 5 --force swift://owncloud_{{ inventory_hostname|lower }}
rm /root/backup-$PGDATABASE.sql
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment