ds1080/backup-bot

By ds1080

Updated 2 months ago

encrypt and backup latest directory to remote servers

Image

699

USAGE

Variables

$TZ # timezone
$DELAY # time to wait before restarting
$NAME # name for gpg key creation
$PASSPHRASE # passphrase for gpg key creation
$EMAIL #email for gpg key creation
$IP #ip address of remote server
$DIRECTORY #directory on remote share
$USERNAME #username on remote share
$PASSWORD #password on remote share
$EXTRA_COMMANDS #any extra comands you wish to run after the backup is finished

Directories

/root/.gnupg #container's directory to store keys
/mnt/local #container's directory for directories to be transferred

Examples

Docker
docker run /
  -d /
  --name='backup-bot' /
  -e 'TZ'="America/Los_Angeles" /
  -e 'NAME'='myname' /
  -e 'EMAIL'='myusername@myemail.com' /
  -e 'PASSPHRASE'='supersecretpassphrase' /
  -e 'IP'='123.123.123.123' /
  -e 'DIRECTORY'='mybackupdirectory' /
  -e 'USERNAME'='someusername' /
  -e 'PASSWORD'='remotepassword' /
  -e 'EXTRA_COMMANDS'='ls -Fd /mnt/remote/ab_*|grep '/$'|head -n -3|while read -r d; do rm -rf "$d"; done && echo "finished cleaning up old backups"'/
  -v '/mnt/user/CommunityApplicationsAppdataBackup/':'/mnt/local':'rw' /
  -v '/mnt/user/appdata/backup-bot/':'/root/.gnupg/':'rw' /
  ds1080/backup-bot 
Docker-Compose
name: backup-bot
services:
   backup-bot:
       container_name: backup-bot
       environment:
           - TZ=America/Los_Angeles
           - NAME=myname
           - EMAIL=myusername@myemail.com
           - IP=123.123.123.123
           - DIRECTORY=mybackupdirectory
           - USERNAME=someusername
           - PASSPHRASE=supersecretpassphrase
           - PASSWORD=remotepassword
           - EXTRA_COMMANDS='ls -Fd /mnt/remote/ab_*|grep '/$'|head -n -3|while read -r d; do rm -rf "$d"; done && echo "finished cleaning up old backups"'
       volumes:
           - /mnt/user/CommunityApplicationsAppdataBackup/:/mnt/local:rw
           - /mnt/user/appdata/backup-bot/:/root/.gnupg/:rw
       image: "ds1080/backup-bot"

Docker Pull Command

docker pull ds1080/backup-bot