If you are using virtual machines on a Linux system, you may be storing the VM image in an LVM partition. This can make it difficult to copy or backup an image of the VM.
The attached script will do just that. It displays the list of VMs running on the system and allows you to select which one to copy. If the VM is currently running, it will optionally shut it down before doing the backup; if it can’t or you don’t want it to shut it down, it will wait for you to shut it down manually. When complete, it will optionally restart the vm (if it had been running when the script started) and compress the image file if desired.
The only hard-coded value is the DESTDIR, which is where the images are stored.
The script will NOT backup image files.
makeimg.sh.gz (1.1 KiB, 427 hits)