backup of VMWare using

You can back up VMware VM for free using script. Everything you need is here:

I was unable to download it directly to the the VMware server because wget v1.19 refused to download form https:// url.

Instead I downloaded the file to my Windows machine and used WinSCPPortable to upload the file to the server.

To extract the files do:


Go to ghettoVCB-master folder and make the scripts executable:

chmod +x
chmod +x

Add a new NFS share as a datastore “backup”. This is where we are going to store the backup files.

Create some folders and configuration files. A typical way to execute the script is:

./ -f vms_to_backup -g global_config/vm_global.conf

To schedule a cron job add the following line to /var/spool/cron/crontabs/root

0 0 * * 1-5 /scratch/ghettoVCB-master/ -f /scratch/ghettoVCB-master/vms_to_backup -g /scratch/ghettoVCB-master/global_config/vm_global.conf > /vmfs/volumes/backup/ghettoVCB-backup-$(date +\%s).log

Then add the following to /etc/rc.local.d/

/bin/kill $(cat /var/run/
/bin/echo “0 0 * * 1-5 /scratch/ghettoVCB-master/ -f /scratch/ghettoVCB-master/vms_to_backup -g /scratch/ghettoVCB-master/global_config/vm_global.conf > /vmfs/volumes/backup/ghettoVCB-backup-\$(date +\\%s).log” >> /var/spool/cron/crontabs/root

In order to allow the script to send emails you need to:

Step 1 – Create a file called /etc/vmware/firewall/email.xml with contains the following:


Step 2 – Reload the ESXi firewall by running the following ESXCLI command:

~ # esxcli network firewall refresh

Step 3 – Confirm that your email rule has been loaded by running the following ESXCLI command:

~ # esxcli network firewall ruleset list | grep email
email                  true

Step 4 – Connect to your email server by using nc (netcat) by running the following command and specifying the IP Address/Port of your email server:

~ # nc 25
220 ESMTP Postfix

To perform a dry run restore do:

./ -c vms_to_restore -d 1

To perform a real restore do:

./ -c vms_to_restore