{"id":16151322,"url":"https://github.com/azlux/borgbackup-docker","last_synced_at":"2025-04-28T12:57:05.509Z","repository":{"id":69708702,"uuid":"276498782","full_name":"azlux/borgbackup-docker","owner":"azlux","description":"Backup with BorgBackup for both folders and mysql/postgres database","archived":false,"fork":false,"pushed_at":"2025-01-03T10:56:06.000Z","size":40,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T19:37:26.045Z","etag":null,"topics":["borgbackup"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azlux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-01T22:56:51.000Z","updated_at":"2025-01-03T10:56:10.000Z","dependencies_parsed_at":"2025-01-03T11:40:45.971Z","dependency_job_id":"3663c9aa-2a9e-4c8f-8375-a47023d2960b","html_url":"https://github.com/azlux/borgbackup-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azlux%2Fborgbackup-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azlux%2Fborgbackup-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azlux%2Fborgbackup-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azlux%2Fborgbackup-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azlux","download_url":"https://codeload.github.com/azlux/borgbackup-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301965,"owners_count":20755512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["borgbackup"],"created_at":"2024-10-10T00:55:59.604Z","updated_at":"2025-03-31T10:31:28.302Z","avatar_url":"https://github.com/azlux.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# borgbackup-docker\nBackup folders from environment variables with [BorgBackup tool](https://www.borgbackup.org/).\n\nBuild every week for the base image update, and, of course, at every commit : [![Build Status](https://ci.azlux.fr/api/badges/azlux/borgbackup-docker/status.svg)](https://ci.azlux.fr/azlux/borgbackup-docker)\n\nI've create this image to have :\n - Simple to use backup tool (by borgbackup)\n - Easy management with folder with few mount\n - Easy to run with internal cron (to avoid cron task on the host), optional if you have you own task manager (see ONESHOT variable).\n - Easy setup with environnement variables\n - MySQL backup included\n - Postgres backup included\n - All backups encrypted (by borgbackup)\n\nFeel free to improve the code on the github with pull requests and questions.\n\nDocker Hub link : https://hub.docker.com/r/azlux/borgbackup\n\n## Environnements variables:\n\n### Mandatory:\n- `BORG_PASSPHRASE` - borgbackup passphrase\n- `FOLDERS_TO_BACKUP_PATH` - folder path where you put the Volumes to backup\n- `BACKUP_PATH` - Backup Volume path\n\n### Optionnal\nIf MySQL or Postgres values are given, mysqldump and/or pg_dumpall will be executed and added to the backup.\n- `MYSQL_USER` - MySQL User (with all table read access)\n- `MYSQL_PASSWORD` - MySQL Password\n- `MYSQL_HOST` - IP or name of the MysQL Host\n- `POSTGRES_USER` - POSTGRES User (with all table read access)\n- `POSTGRES_PASSWORD` - POSTGRES Password\n- `POSTGRES_HOST` - IP or name of the POSTGRES Host\n- `POSTGRES_VERSION` - Version of the postgres database if different from bookworm version\n- `BORG_KEEP_WITHIN` - keep all archives within this time interval (default: `\"14d\"`)\n- `BORG_KEEP_WEEKLY` - number of weekly archives to keep (default: `8`)\n- `BORG_KEEP_MONTHLY` - number of monthly archives to keep (default: `6`)\n- `BACKUP_CRON` - Custom CRON time (`0 3 * * *` :every day at 3AM by default)\n- `ONESHOT` - (true/false) Run the backup without cron (usefull if you have eternal scheduler) - False by default\n\nSee https://borgbackup.readthedocs.io/en/1.2-maint/usage/prune.html for the `BORG_KEEP_XXX`variables\n\n## Docker-compose v2 example:\n```\nbackup:\n    image: azlux/borgbackup\n    container_name: backup\n    hostname: backup\n    restart: on-failure\n    environment:\n        BORG_PASSPHRASE: ${BORG_PASSPHRASE}\n        FOLDERS_TO_BACKUP_PATH: /folder_to_backup\n        BACKUP_PATH: /backup\n        MYSQL_USER: root\n        MYSQL_PASSWORD: ${MARIADB_MYSQL_ROOT_PASSWORD}\n        MYSQL_HOST: mariadb\n    volumes:\n        - /first/path/on/host:/folder_to_backup/data1\n        - /second/path/on/host:/folder_to_backup/data2\n        - ...\n        - /backup/path/on/host:/backup\n    tmpfs: /tmp\n```\n## How to restore\nI didn't implement automatic restore, tools are already included.\n\nThe Docker image allow you to start a bash, so you can run with:\n```bash\ndocker run -it -e BORG_PASSPHRASE=\"YOUR_BORG_PASSPHRASE\" -v \"/dir/of/your/backup:/backup\" -e \"BACKUP_PATH=/backup\"  azlux/borgbackup bash\n```\n\nThen you will have a bash, with the `borg` command available with all the posibilities from the CLI : [See the official doc](https://borgbackup.readthedocs.io/en/stable/index.html)\nUsefull command to restore:\n- `borg list /backup` [doc](https://borgbackup.readthedocs.io/en/stable/usage/list.html)\n- `borg extract --progress /backup::name-of-the-backup-with-date` [doc](https://borgbackup.readthedocs.io/en/stable/usage/extract.html)\n  - a folder named with `FOLDERS_TO_BACKUP_PATH` will be created\n\n## Why Debian\nMany people ask me for alpine image. If you want one, don't take my image.\n\nAfter many years on docker, Alpine is the main source of my problems encountered.\nMaybe, one day they will have a stable DNS support (no reproductible issues took me so many hours to debug).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazlux%2Fborgbackup-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazlux%2Fborgbackup-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazlux%2Fborgbackup-docker/lists"}