== Installation (Debian) == apt-get install duplicity python-paramiko python-gobject-2 python-boto mkdir /etc/duply download Duply (http://duply.net) == add a profile == gpg --gen-key duply create you will see something like this: gpg: key --> D4B41D3E <-- marked as ultimately trusted public and secret key created and signed. here "D4B41D3E" is the key id the directory /etc/duply// will be created. the file /etc/duply//conf could be look like this: GPG_KEY='' GPG_PW='' TARGET='s3+http:///' TARGET_USER='' TARGET_PASS='' SOURCE='' DUPL_PARAMS='--s3-use-new-style --s3-european-buckets' MAX_FULL_BACKUPS=2 == Database Backups == if you use my cron script (see cron script) for database backups the profile name should start with "db-". = the pre file == the file "pre" should look like this: #!/bin/bash /bin/mkdir /root/database-backup 2> /dev/null /bin/rm /root/database-backup/* 2> /dev/null /usr/bin/mysqldump -u root --all-databases --hex-blob | \ /bin/gzip > \ /root/database-backup/`/bin/hostname`_`/bin/date +%Y-%m-%d_%H-%M-%S`.sql.gz = the .my.cnf file = an important note is that the user "root" could authenticate to yout db without any password. to archive this you can put yout db credentials to "/root/.my.cnf". [client] password= please note that "/root/.my.cnf" is owned by root and it's access mask is set to 600. Die Benutzerrechte von ./root/.my.cnf. sollten auf .600. gesetzt sein. = the post file = the file "post" could look like this: #!/bin/bash /bin/rm -r /root/database-backup 2> /dev/null Note: all files below "/etc/duply" should be owned by root and it's access mask should be set to 600. == do the backup manualy == FULL: duply pre duply full duply post INCREMENTAL: duply pre duply incr duply post delete old backups: duply purge-full --force ********* IMPORTANT !!! ************** be shure you got minimal TWO backups of "/etc/duply" stored on different secure places !!! == cron script == die Datei '/etc/cron.daily/duply' #!/bin/bash FILE=/tmp/duply.tmp DUPLY=/usr/local/sbin/duply RM=`which rm` ECHO=`which echo` CAT=`which cat` GREP=`which grep` SED=`which sed` DATE=`which date` single_backup () { $ECHO "single backup (mode=$2): $1" >> $FILE $DUPLY $1 pre | $SED 's/\n/\r\n/g' >> $FILE $DUPLY $1 $2 | $SED 's/\n/\r\n/g' >> $FILE $DUPLY $1 post | $SED 's/\n/\r\n/g' >> $FILE if [[ "$MODE" == "full" ]] ; then $DUPLY $1 purge-full --force | $SED 's/\n/\r\n/g' >> $FILE fi } db_backup () { $ECHO "db backup: $1" >> $FILE $DUPLY $1 pre | $SED 's/\n/\r\n/g' >> $FILE $DUPLY $1 full | $SED 's/\n/\r\n/g' >> $FILE $DUPLY $1 post | $SED 's/\n/\r\n/g' >> $FILE $DUPLY $1 purge-full --force | $SED 's/\n/\r\n/g' >> $FILE } backup () { $ECHO "backup all: $MODE" >> $FILE $RM $FILE 2> /dev/null for i in `ls -1 /etc/duply` ; do if $ECHO $i | $GREP -q "^db-" ; then db_backup $i else single_backup $i $1 fi done $ECHO "all done." >> $FILE $CAT - $FILE << EOF | sendmail -t to:duply@kmcloud.de from:duply@kmcloud.de subject:daily duply report EOF $RM $FILE 2> /dev/null } MODE=incr if [[ `$DATE +%d` == "01" ]] ; then MODE=full fi backup $MODE == restore == To restore the whole backup to /tmp I use this command: duply restore /tmp/restore To restore the lastest version of a file from to /tmp I use this command: duply fetch etc/myfile /tmp/restore To restore the version from 4 days ago of a file from my to /tmp I use this command: duply fetch etc/myfile /tmp/restore 4D