#!/usr/bin/env bash ## BACKUP_PATH is a list of paths to backup, seperated by a space. ## If there is a spaces in your path (shame on you), escape them first. ## Like this: # BACKUP_PATH="/home/use/first\ path\ with\ spaces /home/user/second_path /home/user/third_path" # BACKUP_PATH="/home/user/just_one_path" ## In the sample only /home is being backed up. BACKUP_PATH="/home" ## Backup exclude is a file containing paths that should be backed up, like pseudo filesystems. BACKUP_EXCLUDE="backup_exclude.txt.sample" ## Setup Path and file for logging LOGPATH="/var/log/borg" mkdir -p $LOGPATH export LOGFILE="$LOGPATH/backup_docker.log" export LASTLOG="$LOGPATH/backup_docker.log.last" ## Path to private-key PRIVATE_KEY_FILE="./id_ed25519" ## URL of storage server ## samle url scheme used by Hetzner storage services ## REPOSITORY_URL="u000000.your-backup.de" ## REPOSITORY_URL="u000000.your-storagebox.de" REPOSITORY_URL="disaster-recovery.example.com" ## Port to be used on repository server REPOSITORY_PORT="23" ## Directory of backup on server REPOSITORY_DIR="test" ## Username on repository server REPOSITORY_USER="u000000" ## Setup BORG environment export BORG_RSH="ssh -i $PRIVATE_KEY_FILE" export REPOSITORY="ssh://{$REPOSITORY_USER}@{$REPOSITORY_URL}:{$REPOSITORY_PORT}/./{$REPOSITORY_DIR}/" export BACKUP_NAME="$(date +%Y-%m-%d_%H%M)" ## Secret ## This is your passphrase used to encrypt the backup. ## If you lose this, you lose EVERYTHING! ## Keep it safe and secure. export BORG_PASSPHRASE="soe4eiCae9ohSij7Aiceesh2ZiphiHoh"