{"id":21422542,"url":"https://github.com/zerwes/ansible-role-backup","last_synced_at":"2026-05-04T12:36:40.207Z","repository":{"id":87158813,"uuid":"123737123","full_name":"zerwes/ansible-role-backup","owner":"zerwes","description":"configure hosts as backup client / server and run a scheduled backup from the server using rsync+ssh","archived":false,"fork":false,"pushed_at":"2024-08-04T12:12:43.000Z","size":52,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T06:46:05.564Z","etag":null,"topics":["ansible","ansible-role","backup","rsync","shell","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zerwes.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,"publiccode":null,"codemeta":null}},"created_at":"2018-03-03T22:34:27.000Z","updated_at":"2024-08-04T12:12:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"32039b45-074f-443d-a941-0bb6b010eb9c","html_url":"https://github.com/zerwes/ansible-role-backup","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/zerwes%2Fansible-role-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerwes%2Fansible-role-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerwes%2Fansible-role-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerwes%2Fansible-role-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerwes","download_url":"https://codeload.github.com/zerwes/ansible-role-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926016,"owners_count":20369914,"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":["ansible","ansible-role","backup","rsync","shell","ssh"],"created_at":"2024-11-22T20:49:40.061Z","updated_at":"2026-05-04T12:36:35.185Z","avatar_url":"https://github.com/zerwes.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)\n\n# ansible-role-backup\n\nconfigure hosts as backup client / server and run a scheduled backup from the server using rsync+ssh\n\noptional: handle lxc container on proxmox for backup and use lvm snapshots\n\n## Steps:\n\n### hosts file\n\nadd the groups `backup_client` and `backup_server` to the hosts file.\n\n```\n[backup_client]\nhost1\nhost2\n\n[backup_server]\nbsrv\n```\n\n### site.yml\n\nadd the backup role to the server and the clients\n\n```\n- hosts: backup_server\n  roles:\n    - { role: backup, tags: backup }\n- hosts: backup_client\n  roles:\n    - { role: backup, tags: backup }\n```\n\n### host vars\n\n#### backup_server\n\n```\nbackup_server: yes\n# optional you can adjust some paths\nbackup_server_path_local: /srv/backup\nbackup_server_path_sshkey: /root/.ssh/id_rsa\nbackup_server_path_logdir: /var/log/backup\nbackup_server_path_status: /var/tmp/backup.status\n\n```\n\n#### backup_client\n\n```\n# list of directories to backup\nbackup_client_dirs:\n  - /etc/\n  - /srv/\n\n# list of pattern to use as --include= arg\nbackup_client_include: []\n\n# list of pattern to use as --exclude= arg\nbackup_client_exclude: []\n\n# list of services to stop befor and start after the backup\nbackup_client_services: []\n\n# list of databases to dump before the backup\nbackup_client_databases: []\n\n# optional: list of commands to run before backup\n# backup_client_exec_pre:\n\n# optional: list of commands to run after backup\n# backup_client_exec_post\n\n# rotate backups\nbackup_client_rotatecount_daily: 0\nbackup_client_rotatecount_weekly: 0\nbackup_client_rotatecount_monthly: 0\nbackup_client_rotate_weekly_day: 0 # 0=sunday\nbackup_client_rotate_monthly_day: 1 # -1=last day of month\n```\n\noptional: configure client to backup multiple lxc containers\n\n```\nbackup_client_pve: {...}\n# if configured, the backup client can be a backup proxy for proxmox lcx containers running on it\n# q: why use this method instead of running the client script on the container itself?\n# a: we can use lvm snapshots so the downtime of the services on the container can be minimized\n# if you like to make use of this, ensure the backup_client_user has the right to perform the required tasks\n# or use ackup_client_user: root + backup_client_user_sshdir: /root/.ssh\n```\n\n# TODOs / FIXMEs\n\n- [ ] mysql dump: make user / pw configurable\n- [ ] check mk local check\n- [ ] test exclude / include args (esp. regarding the \"Sending command\"\n- [ ] rsync -R and --delete ...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerwes%2Fansible-role-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerwes%2Fansible-role-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerwes%2Fansible-role-backup/lists"}