#!/bin/bash # Add Tartarus to your source list echo -e "\n\n# Tartarus" >> /etc/apt/sources.list echo "deb http://wertarbyte.de/apt/ ./" >> /etc/apt/sources.list # Import the GnuPG key with which the repository is signed, and to install the program wget -O /etc/apt/sources.list.d/wertarbyte.list http://wertarbyte.de/apt/wertarbyte-apt.list wget -O - http://wertarbyte.de/apt/software-key.gpg | apt-key add - apt-get update apt-get install tartarus # The script uses a variety of classic Unix tools using the package management – if not already done – Install the following apt-get install tar bzip2 lvm2 gnupg curl # Create Tartarus dir mkdir /etc/tartarus/ # Create config file echo "Enter FTP server address and dir:" read ftp echo "Enter FTP user:" read usr echo "Enter FTP password:" read -s pwd echo "# File: etc/tartarus/generic.inc # Modified # / Etc / tartarus / generic.inc # Generic settings for the backup # Storage method STORAGE_METHOD=\"FTP\" # Address of the FTP server STORAGE_FTP_SERVER=\"$ftp\" # FTP access STORAGE_FTP_USER=\"$usr\" STORAGE_FTP_PASSWORD=\"$pwd\" #Compression method COMPRESSION_METHOD=\"bzip2\" # Backup data encrypt symmetrically ENCRYPT_SYMMETRICALLY=\"yes\" # Password from / etc / tartarus / backup.sec read ENCRYPT_PASSPHRASE_FILE=\"/etc/tartarus/backup.sec\" # While the backup was not # File system limits beyond STAY_IN_FILESYSTEM=\"yes\" # Helper script Charon which removes stored # backups exceeding a specific age and is # included in the tartarus distribution package. # Hook in Charon TARTARUS_POST_PROCESS_HOOK() { # pass configuration variables to charon # transmit the password through stdin to hide it from "ps ax" local CHARON=\"/usr/sbin/charon.ftp\" local MAX_AGE_IN_DAYS=\"7\" echo -n \"\$STORAGE_FTP_PASSWORD\" | \$CHARON \\ --host \"\$STORAGE_FTP_SERVER\" \\ --user \"\$STORAGE_FTP_USER\" --readpassword \\ --maxage \"\$MAX_AGE_IN_DAYS\" \\ --dir \"\$STORAGE_FTP_DIR\" --profile \"\$NAME\" } # Logging to syslog TARTARUS_DEBUG_HOOK() { echo \$DEBUGMSG | logger }" > /etc/tartarus/generic.inc # Create root configuration echo "# Read main config source /etc/tartarus/generic.inc # Profile name NAME=\"root\" # What to backup DIRECTORY=\"/\" # To exlude EXCLUDE=\"/tmp/ /proc/ /sys/ /var/tmp/ /var/run/\" # No LVM snapshot CREATE_LVM_SNAPSHOT=\"no\" INCREMENTAL_TIMESTAMP_FILE=\"/var/spool/tartarus/timestamps/root\"" > /etc/tartarus/root.conf