Hi all,
Long time reader first time poster
I need to make my 1st ever script to backup VMware workstation VMs to a folder which is then backed up offsite.
Here is what I have so far (will be croned):
Code:
sudo vmrun -T ws stop "/home/gareth/vmware/NagiosWeb/NagiosWeb.vmx" soft
sudo vmrun -T ws stop "/home/gareth/vmware/UbuntuBackup/UbuntuBackup.vmx" soft
**copy or rsync to /home/gareth/vmware-backup/ dir**
sudo vmrun -T ws start"/home/gareth/vmware/NagiosWeb/NagiosWeb.vmx"
sudo vmrun -T ws start "/home/gareth/vmware/UbuntuBackup/UbuntuBackup.vmx"
The commands on their own work but I'm unclear on the below:
1. Just to confirm, I need to place the above in a file with #!/bin/bash at the top and make it executable
2. How do I know when the VMs have safely shut down so I can start the copy? I guess I can either a. wait a specified amount of time b. run some sort of if statement to confirm they are off
3. How do I use Rsync or cp to copy to the backup folder?
4. How will I know the copy is complete so that I can start the VMs again?
Any help would be greatly appreciated. Thanks