Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| backup [2013/04/22 12:01] – [Ubuntu] gerald | backup [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
|---|---|---|---|
| Zeile 12: | Zeile 12: | ||
| Beim 1. Backup fragt einen das Programm, ob man verschlüsseln will... (und arbeitet dabei mit der .ICEauthority) | Beim 1. Backup fragt einen das Programm, ob man verschlüsseln will... (und arbeitet dabei mit der .ICEauthority) | ||
| + | |||
| + | |||
| + | ===== 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 | ||
| + | #!/bin/sh | ||
| + | # | ||
| + | # Script created on 17-6-2008 | ||
| + | # | ||
| + | # This script was created to make Duplicity backups. | ||
| + | # Full backups are made on the 1st day of each month. | ||
| + | # Then incremental backups are made on the other days. | ||
| + | # | ||
| + | # Quielle: http:// | ||
| + | |||
| + | # Loading the day of the month in a variable. | ||
| + | date=`date +%d` | ||
| + | |||
| + | # call with parameter ' | ||
| + | |||
| + | servername=" | ||
| + | |||
| + | # Setting the pass phrase to encrypt the backup files. Will use symmetrical keys in this case. | ||
| + | PASSPHRASE=' | ||
| + | export PASSPHRASE | ||
| + | |||
| + | # Setting the password for the FTP account that the | ||
| + | # backup files will be transferred to. | ||
| + | FTP_PASSWORD=' | ||
| + | export FTP_PASSWORD | ||
| + | |||
| + | # 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 ] || [ " | ||
| + | then | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | #duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | |||
| + | |||
| + | duplicity full -v5 /srv ${servername}/ | ||
| + | duplicity full -v5 /etc ${servername}/ | ||
| + | duplicity full -v5 /home ${servername}/ | ||
| + | duplicity full -v5 / | ||
| + | duplicity full -v5 /var/www ${servername}/ | ||
| + | #duplicity full -v5 --exclude-filelist / | ||
| + | |||
| + | else | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | #duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | duplicity remove-older-than 2M -v5 ${servername}/ | ||
| + | |||
| + | duplicity incremental -v5 /srv ${servername}/ | ||
| + | duplicity incremental -v5 /etc ${servername}/ | ||
| + | duplicity incremental -v5 /home ${servername}/ | ||
| + | duplicity incremental -v5 / | ||
| + | duplicity incremental -v5 /var/www ${servername}/ | ||
| + | #duplicity incremental -v5 --exclude-filelist / | ||
| + | |||
| + | |||
| + | fi | ||
| + | # Check http:// | ||
| + | # for all the options available for Duplicity. | ||
| + | # Unsetting the confidential variables so they are | ||
| + | # gone for sure. | ||
| + | unset PASSPHRASE | ||
| + | unset FTP_PASSWORD | ||
| + | |||
| + | exit 0 | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | / | ||
| + | |||
| + | - /dev | ||
| + | - /proc | ||
| + | - /sys | ||
| + | - /tmp | ||
| + | - /etc | ||
| + | - /home | ||
| + | - /srv | ||
| + | - /var/cache | ||
| + | |||
| + | </ | ||