Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
backup [2015/06/08 16:22] – Externe Bearbeitung 127.0.0.1 | backup [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 15: | Zeile 15: | ||
===== Debian-Server ===== | ===== Debian-Server ===== | ||
+ | neues Script: ((http:// | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | # Simple script for creating backups with Duplicity. | ||
+ | # Full backups are made on the 1st day of each month or with the ' | ||
+ | # Incremental backups are made on any other days. | ||
+ | # | ||
+ | # USAGE: backup.sh [full] | ||
+ | # | ||
+ | # get day of the month | ||
+ | DATE=`date +%d` | ||
+ | |||
+ | # Set protocol (use scp for sftp and ftp for FTP, see manpage for more) | ||
+ | BPROTO=scp | ||
+ | |||
+ | # set user and hostname of backup account | ||
+ | BUSER=' | ||
+ | BHOST=' | ||
+ | |||
+ | # Setting the password for the Backup account that the | ||
+ | # backup files will be transferred to. | ||
+ | # for sftp a public key can be used, see: | ||
+ | # http:// | ||
+ | # | ||
+ | |||
+ | # directories to backup (use . for /) | ||
+ | BDIRS=" | ||
+ | TDIR=`hostname -s` | ||
+ | LOGDIR='/ | ||
+ | |||
+ | # Setting the pass phrase to encrypt the backup files. Will use symmetrical keys in this case. | ||
+ | PASSPHRASE=' | ||
+ | export PASSPHRASE | ||
+ | |||
+ | # encryption algorithm for gpg, disable for default (CAST5) | ||
+ | # see available ones via 'gpg --version' | ||
+ | ALGO=AES | ||
+ | |||
+ | ############################## | ||
+ | |||
+ | if [ $ALGO ]; then | ||
+ | | ||
+ | fi | ||
+ | |||
+ | if [ $BPASSWORD ]; then | ||
+ | | ||
+ | else | ||
+ | | ||
+ | fi | ||
+ | |||
+ | # Check to see if we're at the first of the month. | ||
+ | # If we are on the 1st day of the month, then run | ||
+ | # a full backup. If not, then run an incremental | ||
+ | # backup. | ||
+ | |||
+ | if [ $DATE = 01 ] || [ " | ||
+ | | ||
+ | else | ||
+ | | ||
+ | fi | ||
+ | |||
+ | for DIR in $BDIRS | ||
+ | do | ||
+ | if [ $DIR = ' | ||
+ | EXCLUDELIST='/ | ||
+ | else | ||
+ | EXCLUDELIST="/ | ||
+ | fi | ||
+ | |||
+ | if [ -f $EXCLUDELIST ]; then | ||
+ | EXCLUDE=" | ||
+ | else | ||
+ | EXCLUDE='' | ||
+ | fi | ||
+ | |||
+ | # first remove everything older than 2 months | ||
+ | if [ $DIR = ' | ||
+ | | ||
+ | else | ||
+ | | ||
+ | fi | ||
+ | eval $CMD | ||
+ | |||
+ | # do a backup | ||
+ | if [ $DIR = ' | ||
+ | CMD=" | ||
+ | else | ||
+ | CMD=" | ||
+ | fi | ||
+ | eval $CMD | ||
+ | |||
+ | done | ||
+ | |||
+ | # Check the manpage for all available options for Duplicity. | ||
+ | # Unsetting the confidential variables | ||
+ | unset PASSPHRASE | ||
+ | unset FTP_PASSWORD | ||
+ | |||
+ | exit 0 | ||
+ | |||
+ | </ | ||
+ | Altes Script: | ||
< | < | ||
cat duplicity.sh | cat duplicity.sh |