continuous-integration/drone/push Build is passing
Details
|
||
---|---|---|
.drone.yml | ||
Dockerfile | ||
README.md | ||
cron_backup | ||
entrypoint.sh | ||
script_backup.sh |
README.md
borgbackup-docker
Backup folders from environment variables with BorgBackup tool. Forked from azlux/borgbackup-docker
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 passphraseFOLDERS_TO_BACKUP_PATH
- folder path where you put the Volumes to backupBACKUP_PATH
- Backup Volume path in distant serverBORGHOST
- SSH host to distant backupPORT
- 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 PasswordMYSQL_HOST
- IP or name of the MysQL HostPOSTGRES_USER
- POSTGRES User (with all table read access)POSTGRES_PASSWORD
- POSTGRES PasswordPOSTGRES_HOST
- IP or name of the POSTGRES HostPOSTGRES_VERSION
- Version of the postgres database if different from bullseye versionBACKUP_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