{"id":16814946,"url":"https://github.com/techknowlogick/restic-mysqldump-docker","last_synced_at":"2026-04-16T12:04:24.627Z","repository":{"id":97430714,"uuid":"266259779","full_name":"techknowlogick/restic-mysqldump-docker","owner":"techknowlogick","description":"Docker image that backs up MariaDB/MySQL to S3 via restic. ","archived":false,"fork":false,"pushed_at":"2020-05-23T06:19:56.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T12:47:52.958Z","etag":null,"topics":["backup","docker","mariadb","mysql","restic","restic-backups"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techknowlogick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-05-23T04:04:49.000Z","updated_at":"2023-05-22T13:41:44.000Z","dependencies_parsed_at":"2023-04-15T20:07:17.159Z","dependency_job_id":null,"html_url":"https://github.com/techknowlogick/restic-mysqldump-docker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/techknowlogick/restic-mysqldump-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Frestic-mysqldump-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Frestic-mysqldump-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Frestic-mysqldump-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Frestic-mysqldump-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techknowlogick","download_url":"https://codeload.github.com/techknowlogick/restic-mysqldump-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techknowlogick%2Frestic-mysqldump-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31884929,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backup","docker","mariadb","mysql","restic","restic-backups"],"created_at":"2024-10-13T10:31:47.176Z","updated_at":"2026-04-16T12:04:24.608Z","avatar_url":"https://github.com/techknowlogick.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# restic-mysqldump\n\nDocker image that runs `mysqldump` individually for every database on a given server and saves incremental encrypted backups via [restic].\n\nBy default:\n\n- Uses S3 as restic repository backend.\n- Runs every hour via cron job.\n- Keeps 24 latest, 7 daily, 4 weekly, and 12 monthly snapshots.\n- Prunes old snapshots every week.\n\n**NOTE:** Pruning requires an exclusive lock, and should be done infrequently from a single host.\n\n\n# Usage\n\nRun:\n\n    $ docker run \\\n    -d \\\n    -e AWS_ACCESS_KEY_ID='...' \\\n    -e AWS_SECRET_ACCESS_KEY='...' \\\n    -e DBHOST='...' \\\n    -e DBPASSWORD='...' \\\n    -e DBUSER='...' \\\n    -e RESTIC_PASSWORD='...' \\\n    -e RESTIC_REPOSITORY='s3:s3.amazonaws.com/...' \\\n    --name restic-mysqldump \\\n    --restart unless-stopped \\\n    interaction/restic-mysqldump\n\nYou can also pass the following environment variables to override the defaults:\n\n    -e RESTIC_BACKUP_SCHEDULE='0 * * * *'  # Hourly\n    -e RESTIC_PRUNE_SCHEDULE='0 14 * * 0'  # Sunday midnight, AEST. Use '' to disable.\n    -e DBPORT='5432'\n    -e RESTIC_KEEP_HOURLY='24'\n    -e RESTIC_KEEP_DAILY='7'\n    -e RESTIC_KEEP_WEEKLY='4'\n    -e RESTIC_KEEP_MONTHLY='12'\n\nYou can backup 5 different database clusters with `DB*_[1..5]`, and assign an arbitrary hostname with `HOSTNAME_[1..5]` (if `DBHOST` is not a fully qualified domain name) environment variables.\n\n    -e HOSTNAME_2='...'\n    -e DBHOST_2='...'\n    -e DBPASSWORD_2='...'\n    -e DBPORT_2='5432'\n    -e DBUSER_2='...'\n\nA `docker-compose.yml` file is provided for convenience.\n\n\n# Restore (macOS)\n\nCreate a `.envrc` file from `.envrc.example` and update with your AWS, PostgreSQL and Restic credentials.\n\n    $ wget https://raw.githubusercontent.com/techknowlogick/restic-mysqldump/master/.envrc.example -O .envrc\n\nRestrict access to `.envrc`, because it contains AWS and restic credentials:\n\n    $ chmod 600 .envrc\n\nInstall [direnv] via [Homebrew] and configure to ensure your `.envrc` file is always sourced when you change to this directory:\n\n    $ brew install direnv\n    $ eval \"$(direnv hook bash)\"  # Change bash to zsh/fish/tcsh, if necessary, and add to your shell's RC file\n    $ direnv allow\n\nInstall [restic] via [Homebrew]:\n\n    $ brew install restic\n\nList snapshots:\n\n    $ restic snapshots\n\nRestore the latest snapshot for a given server:\n\n    $ restic restore --host {HOSTNAME} --target \"restore/{HOSTNAME}\" latest\n\nRestore files matching a pattern from latest snapshot for a given server:\n\n    $ restic restore --host \"{HOSTNAME}\" --target \"restore/{HOSTNAME}\" --include '*-production.sql' latest\n\nMount the restic repository via fuse (read-only):\n\n    $ restic mount mnt\n\nThen, access the latest snapshot from another terminal:\n\n    $ ls -l \"mnt/hosts/{HOSTNAME}/latest\"\n\n**WARNING:** Mounting the restic repository via fuse will open an exclusive lock and prevent all scheduled backups until the lock is released.\n\n\n[direnv]: https://direnv.net/\n[Homebrew]: https://brew.sh/\n[restic]: https://restic.net/\n\n# Credit\n\nThis repo is forked from https://github.com/ixc/restic-pg-dump-docker which is a restic backup container for postgres.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Frestic-mysqldump-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechknowlogick%2Frestic-mysqldump-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechknowlogick%2Frestic-mysqldump-docker/lists"}