Backup with BorgBackup for both folders and mysql/postgres database
 
 
Go to file
Draconis 54ef99484e
continuous-integration/drone/push Build is passing Details
nouveau readme
2023-02-26 14:39:09 +01:00
.drone.yml first commit 2023-02-25 11:18:10 +01:00
Dockerfile modifs ssh 2023-02-26 13:01:22 +01:00
README.md nouveau readme 2023-02-26 14:39:09 +01:00
cron_backup fix cron 2020-10-19 23:41:35 +02:00
entrypoint.sh correction fi 2023-02-25 16:00:39 +01:00
script_backup.sh modifs 2023-02-25 15:50:45 +01:00

README.md

borgbackup-docker

Backup folders from environment variables with BorgBackup tool. Forked from azlux/borgbackup-docker

Build Status

I've create this image to have :

  • Simple to use backup
  • Easy management with mount and cron, optional (to avoid cron task on the host).
  • Easy setup with environnement variables
  • MySQL backup included
  • All backups encrypted
  • External backup from SSH

Environnements variables:

Mandatory:

  • BORG_PASSPHRASE - borgbackup passphrase
  • FOLDERS_TO_BACKUP_PATH - folder path where you put the Volumes to backup
  • BACKUP_PATH - Backup Volume path in distant server
  • BORGHOST - SSH host to distant backup
  • PORT - SSH port if diffrent from ssh default port

Optionnal

If MySQL or Postgres values are given, mysqldump and/or pg_dumpall will be executed and added to the backup.

  • MYSQL_USER - MySQL User (with all table read access)
  • MYSQL_PASSWORD - MySQL Password
  • MYSQL_HOST - IP or name of the MysQL Host
  • POSTGRES_USER - POSTGRES User (with all table read access)
  • POSTGRES_PASSWORD - POSTGRES Password
  • POSTGRES_HOST - IP or name of the POSTGRES Host
  • POSTGRES_VERSION - Version of the postgres database if different from bullseye version
  • BACKUP_CRON - Custom CRON time (0 3 * * * :every day at 3AM by default)
  • ONESHOT - (true/false) Run the backup without cron (usefull if you have eternal scheduler) - False by default

Docker-compose v2 example:

backup:
    image: git.draconis.me/borgbackup-docker
    container_name: backup
    hostname: backup
    restart: on-failure
    environment:
        BORG_PASSPHRASE: ${BORG_PASSPHRASE}
        FOLDERS_TO_BACKUP_PATH: /folder_to_backup
        BACKUP_PATH: /backup
        MYSQL_USER: root
        MYSQL_PASSWORD: ${MARIADB_MYSQL_ROOT_PASSWORD}
        MYSQL_HOST: mariadb
    volumes:
        - /first/path/on/host:/folder_to_backup/data1
        - /second/path/on/host:/folder_to_backup/data2
        - ...
        - /path/to/ssh-data-on-host:/root/.ssh:ro
    tmpfs: /tmp