From 06b8c2609dac3b834dcf33af1f394354771a3fa5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 10 Oct 2017 00:50:25 +0100 Subject: [PATCH] Only sync the database backup if pg_dump succeeds --- cookbooks/db/templates/default/backup-db.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cookbooks/db/templates/default/backup-db.erb b/cookbooks/db/templates/default/backup-db.erb index 492dded40..78ae1c8f7 100644 --- a/cookbooks/db/templates/default/backup-db.erb +++ b/cookbooks/db/templates/default/backup-db.erb @@ -5,9 +5,7 @@ D=`date +%Y-%m-%d` F=/store/backup/osm-${D}.dmp -pg_dump --user=backup --format=custom --file=$F openstreetmap - -export RSYNC_RSH="ssh -ax" -rsync $F backup.openstreetmap.org::backup +pg_dump --user=backup --format=custom --file=$F openstreetmap && \ + rsync --rsh="ssh -ax" $F backup.openstreetmap.org::backup rm -f $F -- 2.39.5