6 ### Do not inherit the following variables
7 # Safety net just in case some calls this
8 # script in a bogus way.
19 FTP_HOST=uxxx.your-backup.de
20 LOCKFILE="/var/lock/backup/hetznerbackup"
23 ## Backup job for main
25 echo "Backing up main"
28 duplicity $BMODE $dry /etc $PROTO://$FTP_USER@$FTP_HOST/main/etc
29 duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc
31 echo "Going for /home"
32 duplicity $BMODE $dry /home $PROTO://$FTP_USER@$FTP_HOST/main/home
33 duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home
35 echo "Going for /var/www"
36 duplicity $BMODE $dry /var/www $PROTO://$FTP_USER@$FTP_HOST/main/var/www
37 duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www
39 echo "Going for /var/lib/automysqlbackup"
40 if [ -e /var/lib/automysqlbackup/backupdone ]; then
41 duplicity $BMODE $dry /var/lib/automysqlbackup $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup
42 duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup
44 echo "WARNING: It seems that the last mysql backup is still runing"
45 echo "Skipping mysql backup - please re-schedule"
49 ### check for other runing instances of this script
50 if [ -e $LOCKFILE ]; then
51 echo "Lockfile $LOCKFILE found - aborting"
52 echo "This is a typical result of a failed backup run, please contact your admin"
58 ### Set the duplicity backup mode we would like to use
59 if [[ $(LANG=C; date +%A) =~ Sunday ]]; then
60 echo "Runing in full mode"
63 echo "Runing in incr mode"
67 ### Start the backup jobs
70 ### remove the lockfile