{"id":17063988,"url":"https://github.com/aruhier/virt-backup","last_synced_at":"2025-04-12T18:14:29.946Z","repository":{"id":35125182,"uuid":"64800737","full_name":"aruhier/virt-backup","owner":"aruhier","description":"Backup your kvm guests managed by libvirt","archived":false,"fork":false,"pushed_at":"2024-02-18T13:58:00.000Z","size":430,"stargazers_count":107,"open_issues_count":8,"forks_count":23,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T18:14:09.934Z","etag":null,"topics":["backup","libvirt","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aruhier.png","metadata":{"files":{"readme":"README.mkd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.mkd","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":"2016-08-03T00:05:49.000Z","updated_at":"2025-03-22T08:23:46.000Z","dependencies_parsed_at":"2023-02-17T19:00:42.437Z","dependency_job_id":"e5fbc8ce-0aa2-46cc-8d4e-6c656a6e2763","html_url":"https://github.com/aruhier/virt-backup","commit_stats":null,"previous_names":["anthony25/virt-backup"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruhier%2Fvirt-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruhier%2Fvirt-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruhier%2Fvirt-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aruhier%2Fvirt-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aruhier","download_url":"https://codeload.github.com/aruhier/virt-backup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610336,"owners_count":21132920,"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":["backup","libvirt","python"],"created_at":"2024-10-14T10:53:30.965Z","updated_at":"2025-04-12T18:14:29.917Z","avatar_url":"https://github.com/aruhier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"virt-backup\n===========\n\n[![Build Status](https://travis-ci.org/aruhier/virt-backup.svg?branch=master)](https://travis-ci.org/aruhier/virt-backup)  [![Coverage Status](https://coveralls.io/repos/github/aruhier/virt-backup/badge.svg?branch=master)](https://coveralls.io/github/aruhier/virt-backup?branch=master)\n\nDo external backup of your KVM guests, managed by libvirt, using the\nBlockCommit feature. The main goal is to do a modest alternative to the Proxmox\nVE backup system (without their vma system) to automatically backup your disks\n(with optional compression) and easily restore ones. Guests are configured by\ngroups, and can be matched via regex.\n\n\nDocumentation\n-------------\n\nDocumentation is available [here](https://virt-backup.readthedocs.io/).\n\n\nInstallation\n------------\n\nRun:\n\n```\npip3 install virt-backup\n```\n\nIf you are running on ArchLinux, virt-backup is available through the AUR\npackage `virt-backup`.\nvirt-backup is tested under Python 3.5 and 3.6, 3.7. Python \u003c 3.5 is not\nsupported anymore, due to some deprecations in the used libraries.\n\nvirt-backup should have access to every disk image desired to be backup. It\nshould also be able to run `qemu-img` (normally installed with libvirt), as it\nis used to backup inactive domains.\n\n\nConfiguration\n-------------\n\nThe configuration file is looked up into the following paths, in this specific\norder: `~/.config/virt-backup/config.yml`, `/etc/virt-backup/config.yml`, and,\nif you cloned this repository, in the project's root.\n\nA self-documented example is available in `example/config.yml`.\n\n\nUsage\n-----\n\nRun the application by calling `virt-backup`:\n\n```\n$ virt-backup -h\nusage: virt-backup [-h] [-d] [--version]\n                   {backup,bak,restore,clean,cl,list,ls} ...\n\nBackup and restore your kvm libvirt domains\n\npositional arguments:\n  {backup,bak,restore,clean,cl,list,ls}\n    backup (bak)        backup groups\n    restore             restore backup\n    clean (cl)          clean groups\n    list (ls)           list groups\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d, --debug           set the debug level\n  --version             show program's version number and exit\n```\n\n### Backup\n\nSubcommand allowing to start the backup for all (except those with the\n`autostart` option disabled) or only the specified groups.\n\n```\n$ virt-backup backup -h\nusage: virt-backup backup [-h] [group [group ...]]\n\npositional arguments:\n  group       domain group to backup\n```\n\nFor each domain matching a group, the following process is followed:\n  1. An external snapshot is created for all disks concerned by the backup, in\n     order to freeze the images. For the same domain, all snapshots are created\n     are the same time, so there is no inconsistency between disks.\n  2. A temporary file is created in the backup directory, containing all info\n     to revert the backup if virt-backup crashed during the process (resulting\n     in a broken backup and external snapshots that have not been removed).\n     These backups can be cleaned by using the `clean` subcommand.\n  3. Images are copied.\n  4. BlockCommit is used to merge temporary external snapshots with their base\n     disk, and to pivot to the original disk. If the domain is inactive,\n     libvirt cannot achieve this step, so qemu-img is used.\n  5. Remove all temporary file.\n\n\n### List\n\nList a short summary of multiple or all groups. If a domain name is specified,\nit will list all its backups, sorted by date.\n\n```\n$ virt-backup list -h\nusage: virt-backup list [-h] [-D domain_name] [-s] [group [group ...]]\n\npositional arguments:\n  group                 domain group to list\n\noptional arguments:\n  -D domain_name, --domain domain_name\n                        show list of backups for specific domain\n  -a, --all             show all domains matching, even without backup\n  -s, --short           short version, do not print details\n```\n\nBy default, only domains with at least one backup will be listed, but all\ndomains matching with the group rules can be printed by using the `-a/--all`\noption.\n\n### Restore\n\nRestore a backup. If no date is specified, it will restore the last backup\nfound for the specified group and domain.\n\n```\n$ virt-backup restore -h\nusage: virt-backup restore [-h] [--date date] group domain target_dir\n\npositional arguments:\n  group        domain group\n  domain       domain name\n  target_dir   destination path\n\noptional arguments:\n  --date date  backup date (default: last backup)\n```\n\n### Clean\n\nClean complete backups, depending on the retention policy (as defined for each\ngroup in the configuration), and broken backups.\n\nA systemd service is available in `example/virt-backup-clean.service` to\ntrigger a cleaning of all broken backups at start. This way, if the hypervisor\ncrashed during a backup, the service will clean all temporary files and pivot\nall disks on their original images (instead of running on a temporary\nexternal snapshot).\n\n```\n$ virt-backup clean -h\nusage: virt-backup clean [-h] [-b | -B] [group [group ...]]\n\npositional arguments:\n  group              domain group to clean\n\noptional arguments:\n  -b, --broken-only  only clean broken backups\n  -B, --no-broken    do not clean broken backups\n```\n\nLicense\n-------\n\nTool under the BSD license. Do not hesitate to report bugs, ask me some\nquestions or do some pull request if you want to!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruhier%2Fvirt-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faruhier%2Fvirt-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faruhier%2Fvirt-backup/lists"}