X-Git-Url: http://git.sven.stormbind.net/?a=blobdiff_plain;f=hetzner%2Fhetznerbackupv2.sh;h=8361077902433ae91afcddf18bbb2de7a1bfd706;hb=HEAD;hp=86c7ede180d60f2536095c6f36812585b1d9c9f3;hpb=0d5f2f20d9da1b932020bf17f84ad4cd542cc86a;p=sven%2Fscripts.git diff --git a/hetzner/hetznerbackupv2.sh b/hetzner/hetznerbackupv2.sh deleted file mode 100755 index 86c7ede..0000000 --- a/hetzner/hetznerbackupv2.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -### Halt on errors -set -e - -### Do not inherit the following variables -# Safety net just in case some calls this -# script in a bogus way. -unset $dry - -### Debug -#set -x -#set dry="--dry-run" - -### General settings -export PASSPHRASE=s -export FTP_PASSWORD=s -FTP_USER=uxxx -FTP_HOST=uxxx.your-backup.de -LOCKFILE="/var/lock/backup/hetznerbackup" -PROTO=ssh - -## Backup job for main -job_main() { - echo "Backing up main" - - echo "Going for /etc" - duplicity $BMODE $dry /etc $PROTO://$FTP_USER@$FTP_HOST/main/etc - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc - - echo "Going for /home" - duplicity $BMODE $dry /home $PROTO://$FTP_USER@$FTP_HOST/main/home - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home - - echo "Going for /var/www" - duplicity $BMODE $dry /var/www $PROTO://$FTP_USER@$FTP_HOST/main/var/www - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www - - echo "Going for /var/lib/automysqlbackup" - if [ -e /var/lib/automysqlbackup/backupdone ]; then - duplicity $BMODE $dry /var/lib/automysqlbackup $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup - duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup - else - echo "WARNING: It seems that the last mysql backup is still runing" - echo "Skipping mysql backup - please re-schedule" - fi -} - -### check for other runing instances of this script -if [ -e $LOCKFILE ]; then - echo "Lockfile $LOCKFILE found - aborting" - echo "This is a typical result of a failed backup run, please contact your admin" - exit 5 -else - touch $LOCKFILE -fi - -### Set the duplicity backup mode we would like to use -if [[ $(LANG=C; date +%A) =~ Sunday ]]; then - echo "Runing in full mode" - BMODE="full" -else - echo "Runing in incr mode" - BMODE="incr" -fi - -### Start the backup jobs -job_main - -### remove the lockfile -rm $LOCKFILE