{"id":18337425,"url":"https://github.com/mikemix/percona-xtrabackup-cron","last_synced_at":"2026-02-28T21:30:58.164Z","repository":{"id":149689066,"uuid":"118108747","full_name":"mikemix/percona-xtrabackup-cron","owner":"mikemix","description":"Hot MySQL/MariaDB backup with Percona Xtrabackup running in cron","archived":false,"fork":false,"pushed_at":"2018-04-13T11:23:25.000Z","size":13,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T05:35:37.787Z","etag":null,"topics":["backup","cron","database","docker","mariadb","mount","mysql","percona-xtrabackup"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/mikemix/percona-xtrabackup-cron/","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/mikemix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-01-19T10:00:58.000Z","updated_at":"2025-02-11T21:33:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"78e0e299-866d-40e3-b778-e301f841f95f","html_url":"https://github.com/mikemix/percona-xtrabackup-cron","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mikemix/percona-xtrabackup-cron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemix%2Fpercona-xtrabackup-cron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemix%2Fpercona-xtrabackup-cron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemix%2Fpercona-xtrabackup-cron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemix%2Fpercona-xtrabackup-cron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikemix","download_url":"https://codeload.github.com/mikemix/percona-xtrabackup-cron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemix%2Fpercona-xtrabackup-cron/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29952237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","cron","database","docker","mariadb","mount","mysql","percona-xtrabackup"],"created_at":"2024-11-05T20:11:10.519Z","updated_at":"2026-02-28T21:30:58.127Z","avatar_url":"https://github.com/mikemix.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# percona-xtrabackup-cron\n\nDockerized hot MySQL backup with [Percona Xtrabackup](https://www.percona.com/software/mysql-database/percona-xtrabackup) under cron.\n\n## Setup\n\nSetup is done through a number of environment variables:\n\n| **Variable name** | **Description**     | **Example**                                                                                |\n|-------------------|---------------------|--------------------------------------------------------------------------------------------|\n| CRON              | Cron rules to run   | Do backup at 01:00am each day: `0 1 * * *  backup _name_ \"--compress\" \u003e/dev/console  2\u003e\u00261` |\n| TZ                | The time zone       | Europe/Berlin                                                                              |\n| MYSQL_HOST        | MySQL host name     | 172.17.0.1                                                                                 |\n| MYSQL_PORT        | MySQL port          | 3306                                                                                       |\n| MYSQL_USER        | MySQL user          | root                                                                                       |\n| MYSQL_PASS        | MySQL user password | [your password here]                                                                       |\n\n`MYSQL_` variables are used to connect to the database. You can omit these settings and mount a custom `.cnf` file to the\n[`/root/.my.cnf`](https://github.com/mikemix/percona-xtrabackup-cron#example-mycnf-file) inside the container.\n\n### Example `.my.cnf` file\n\n    [xtrabackup]\n    user=user\n    password=password\n    host=host\n    port=port\n    # any other settings here if you wish\n\n## Container commands\n\n| **Command**  | **Description**                                                                                                                               |\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| xtrabackup   | [The Percona Xtrabackup binary](https://www.percona.com/software/mysql-database/percona-xtrabackup)                                           |\n| backup       | `xtrabackup` proxy. First argument stands for the backup name (eg. `rancher`), second are xtrabackup additional parameters (eg. `--compress`) |\n\n## Standalone Docker setup\n\nExample setup to backup [Rancher](https://rancher.com/) database periodically.\n\n    docker run -it --rm -d --restart=unless-stopped --name backup-rancher \\\n        # path to mysql physical files (read only for security)\n        -v /var/lib/mysql:/var/lib/mysql:ro \\\n        # storage location\n        -v /mnt/backup/rancher:/mnt/backup/rancher \\\n        # backup log (not required)\n        -v /var/backup/backup.log:/var/backup.log \\\n\n        -e CRON='0 1 * * * backup rancher \"--compress --compress-threads=4\" \u003e/dev/console 2\u003e\u00261' \\\n        -e TZ=Europe/Warsaw \\\n        -e MYSQL_HOST='172.17.0.1' -e MYSQL_PORT=3306 -e MYSQL_USER=root -e MYSQL_PASS=password\n\nMake sure the backup location directory name matches your backup name that you set up in the cron rule. \nThis will ensure symlinks created in the container are also usable on your host machine. In this case\nbackup name `rancher` matches the `rancher` directory inside `/mnt/backup` as all backups are stored\nin the `/mnt/backup` inside the container.\n\nThe `--backup --target-dir=/path` arguments are added automatically.\n\n## Backup log\n\nIf a physical file is mounted to the container's `/var/backup.log` location tool will prepend the file\nafter a successful backup with a CSV line:\n\n    [unix time];[yyyy-mm-dd hh:mm:ss];[log name];[log size (eg. 32M)];[log path]\n\nWe then use this file to generate a [Jekyll based](https://jekyllrb.com/) HTML report.\n\n## Generated backup tree example\n\n```\n[root@host /mnt/backup/rancher]$ ls -l\ntotal 4\ndrwxr-xr-x. 4 root root 4096 04-02 01:30 2018\nlrwxrwxrwx. 1 root root   41 04-13 01:30 latest -\u003e /mnt/backup/rancher/2018/04/12/1523575621\nlrwxrwxrwx. 1 root root   41 04-13 01:30 latest-full -\u003e /mnt/backup/rancher/2018/04/12/1523575621\n\n   |-2018\n   |---04\n   |-----05\n   |-------1522970821\n   |-----06\n   |-------1523057221\n   |-----07\n   |-------1523143621\n   |-----08\n   |-------1523230021\n   |-----09\n   |-------1523316421\n   |-----10\n   |-------1523402821\n   |-----11\n   |-------1523489221\n   |-----12\n   |-------1523575621\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemix%2Fpercona-xtrabackup-cron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikemix%2Fpercona-xtrabackup-cron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemix%2Fpercona-xtrabackup-cron/lists"}