Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #Put password in /etc/duplicity/.passphrase and chmod to 600(!)
- INCREMENTS=365
- LOGFILE=" --log-file /var/log/duplicity.log"
- KEYID="CFAAE3DDD"
- MOUNTDIR="/data"
- LOG_LOCATION="/etc/duplicity"
- test -x $(which duplicity) || exit 0
- . /etc/duplicity/.passphrase
- #Umount stackmount
- if sudo -u user mount | grep "stack"
- then
- #echo "Unmount already mounted stack directory, just to be sure"
- sudo -u user umount $MOUNTDIR
- fi
- export PASSPHRASE
- if sudo -u user mount $MOUNTDIR
- then
- ##Don't forget to define with three /// for local directories!
- #mysql
- $(which duplicity) --encrypt-key $KEYID $LOGFILE --num-retries 3 --sign-key $KEYID /var/lib/automysqlbackup file:///data/mysql
- $(which duplicity) remove-all-but-n-full $INCREMENTS --force file:///data/mysql
- #Umount stackmount
- if sudo -u user mount | grep "stack"
- then
- #echo "Umounting stack directory"
- sudo -u user umount $MOUNTDIR
- fi
- else
- echo "Mount failed, please check $MOUNTDIR"
- fi
Advertisement
Add Comment
Please, Sign In to add comment