{"id":15508273,"url":"https://github.com/yeah/virt-backup","last_synced_at":"2026-06-19T16:04:52.370Z","repository":{"id":66511945,"uuid":"115346566","full_name":"yeah/virt-backup","owner":"yeah","description":"A fork of http://gitweb.firewall-services.com/?p=virt-backup;a=summary.","archived":false,"fork":false,"pushed_at":"2017-12-25T15:16:29.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T02:44:03.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","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/yeah.png","metadata":{"files":{"readme":"README","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":"2017-12-25T15:15:33.000Z","updated_at":"2017-12-25T15:16:33.000Z","dependencies_parsed_at":"2023-05-04T23:36:59.503Z","dependency_job_id":null,"html_url":"https://github.com/yeah/virt-backup","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.016393442622950838","last_synced_commit":"b10757e5dc031f739bf59a716f0d4b7c87ad59cc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yeah/virt-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeah%2Fvirt-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeah%2Fvirt-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeah%2Fvirt-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeah%2Fvirt-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeah","download_url":"https://codeload.github.com/yeah/virt-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeah%2Fvirt-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34538480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-02T09:36:51.597Z","updated_at":"2026-06-19T16:04:52.351Z","avatar_url":"https://github.com/yeah.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"This script allows you to backup Virtual Machines managed by libvirt.\nIt has only be tested with KVM based VM\nThis script will dump (or mount as a set of chunks):\n * each block devices\n * optionnally the memory (if --state flag is given)\n * the XML description of the VM\n\nThese files are writen in a temporary backup dir. Everything is done\nin order to minimize donwtime of the guest. For example, it takes\na snapshot of the block devices (if backed with LVM) so the guest is\njust paused for a couple of seconds. Once this is done, the guest is\nresumed, and the script starts to dump the snapshot.\n\nOnce a backup is finished, you'll have several files in the backup\ndirectory. Let's take an example with a VM called my_vm which has\ntwo virtual disks: hda and hdb. You have passed the --state flag:\n * my_vm.lock: lock file to prevent another backup to run at the same time\n * my_vm.xml: this file is the XML description of the VM (for libvirt configuraiton)\n * my_vm_hda.img: this file is an image of the hda drive of the guest\n * my_vm_hdb.img: this file is an image of the hdb drive of the guest\n * my_vm.state: this is a dump of the memory (result of virsh save my_vm my_vm.state)\n\nThis script was made to be ran with BackupPC pre/post commands.\nIn pre-backup, you dump everything (or mount as a set of chunks), then, backuppc backups,\ncompress, pools etc... the dumped file. Eventually, when the backup is finished\nThe script is called with the --action=cleanup flag, which cleanups everything.\n(remove the temporary files, umount the fuse mount points if any etc.)\n\nSome examples:\n\nBackup the VM named mail01 and devsrv. Also dump the memory.\nExclude any virtual disk attached as vdb or hdb and on the fly\ncompress the dumped disks (uses gzip by default)\n\nvirt-backup --dump --vm=mail01,devsrv --state --exclude=vdb,hdb --compress\n\n\nRemove all the files related to mail01 VM in the backup directory\n\nvirt-backup --cleanup --vm=mail01\n\n\nBackup devsrv, use 10G for LVM snapshots (if available), do not dump the memory\n(the guest will just be paused while we take a snapshot)\nKeep the lock file present after the dump\n\nvirt-backup --dump --vm=devsrv --snapsize=10G --keep-lock\n\n\nBackup devsrv, and disable LVM snapshots\n\nvirt-backup --dump --vm=devsrv --no-snapshot\n\n\nBackup mail01, and enable debug (verbose output)\n\nvirt-backup --dump --vm=mail01 --debug\n\n\nBackup winprd, shutdown before taking the backup\nDont wait more than 5 minutes for the shutdown to complete\nrestart the VM once the backup is finished\n\nvirt-backup --action=dump --shutdown --shutdown-timeout=300 --vm=winprd\n\n\nDon't dump, but mount as a set of chunks the disks of vm mail01\n\nvirt-backup --action=chunkmount --vm=mail01\n\nThe idea here is to expose the big blocks/files which represent the VM disks\nas small chunks (default is 256kB), then, you can use your favorite backup script/software\nto backup /var/lib/libvirt/backup/vm_name/ where you want\nThis lets you create incremential backups of VM disks, which can save\na lot of space, a lot of bandwidth, and will also be much more efficient\nwith rsync based backup scripts (because rsync doesn't handle huge files very well\nbut if very efficient with a lot of small files)\nThe cleanup routine (--cleanup or --action=cleanup) will unmount all\nthe chunkfs mount points\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeah%2Fvirt-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeah%2Fvirt-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeah%2Fvirt-backup/lists"}