From 4b666fae8a94056fb2481b9f54fc62a7691182a3 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Tue, 30 Apr 2013 10:55:13 +0200 Subject: [PATCH] Add global options in GOPTS to increase the number of retries from 5 to 15 for hetzner unreliability --- hetzner/hetznerbackupv2.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hetzner/hetznerbackupv2.sh b/hetzner/hetznerbackupv2.sh index d934a02..8361077 100755 --- a/hetzner/hetznerbackupv2.sh +++ b/hetzner/hetznerbackupv2.sh @@ -15,6 +15,7 @@ export FTP_PASSWORD=s FTP_USER=uxxx FTP_HOST=uxxx.your-backup.de PROTO=ssh +GOPTS="--num-retries 15" ROOTMAIL="root@localhost" LOCKDIR="/var/lock/backup" LOCKFILE="$LOCKDIR/hetznerbackup" @@ -29,30 +30,30 @@ job_main() { echo "" >> $SESSIONLOG echo "Going for /etc" >> $SESSIONLOG - duplicity $BMODE $dry /etc $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity $BMODE $dry $GOPTS /etc $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity remove-all-but-n-full 5 --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity cleanup --extra-clean --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1 echo "Going for /home" >> $SESSIONLOG - duplicity $BMODE $dry /home $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity $BMODE $dry $GOPTS /home $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity remove-all-but-n-full 5 --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity cleanup --extra-clean --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 echo "Going for /var/www" >> $SESSIONLOG - duplicity $BMODE $dry /var/www $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity $BMODE $dry $GOPTS /var/www $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity remove-all-but-n-full 5 --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity cleanup --extra-clean --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1 echo "Going for /var/lib/tomcat6" >> $SESSIONLOG - duplicity $BMODE $dry /var/lib/tomcat6 $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity $BMODE $dry $GOPTS /var/lib/tomcat6 $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity remove-all-but-n-full 5 --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity cleanup --extra-clean --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/tomcat6 >> $SESSIONLOG 2>&1 || ERRSTAT=1 echo "Going for /var/lib/automysqlbackup" >> $SESSIONLOG if [ -e /var/lib/automysqlbackup/backupdone ]; then - duplicity $BMODE $dry /var/lib/automysqlbackup $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 - duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity $BMODE $dry $GOPTS /var/lib/automysqlbackup $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity remove-all-but-n-full 5 --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 + duplicity cleanup --extra-clean --force $dry $GOPTS $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1 else echo "WARNING: It seems that the last mysql backup is still runing" >> $SESSIONLOG echo "Skipping mysql backup - please re-schedule" >> $SESSIONLOG -- 2.39.5