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"
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