Created
January 9, 2021 18:58
-
-
Save oBuTr471b/7d20c936802cf89333ccc387f86fc6cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In The Name Of Allah . | |
# -- --- ---- -- ----- - | |
# Sun Jan 3 19:56:30 2021 | |
# Written By : zer0err0r . | |
# ======= == = ========= = | |
# Backup all VMs [.xml] file . | |
# First, Create a new folder to put your [.xml] files in : | |
if [ ! -d ~/xml_files ]; then mkdir ~/xml_files; fi | |
# Then, Lets do it : | |
for item in $(virsh --connect qemu:///system list --all | awk '{print $2}' | grep -v Name); do | |
virsh --connect qemu:///system dumpxml --domain $item > ~/xml_files/${item}.xml | |
virsh --connect qemu:///system vol-dumpxml --pool my_pool --vol ${item}.qcow2 > ~/xml_files/${item}.qcow2.xml | |
done | |
# ===== == ==== ======== = | |
# Peace Be Up0n Muhammed . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment