HOWTO: Backup all VMs

I’m just getting Vertical Backup going, but thought this would be helpful.

  1. Create in Vertical Backup Dir:

     vms=`vim-cmd vmsvc/getallvms | grep "^[0-9]"  | while read vmid therest; do vim-cmd vmsvc/get.summary $vmid | egrep "name" | sed 's/.*= \"//' | sed 's/,//' | sed 's/\" *$//' | awk '{printf("%s", $0)}'; echo; done`
     ./vertical cron --threads <threads> --email <set time> $vms
  2. Add execute perms to script: chmod u+x

  3. Edit /var/spool/cron/crontabs/root

  4. Add the full path to the script above to your cron and set it to run ~10 minutes before you want vertical backup to run.

  5. Restart cron: kill $(cat /var/run/ && /usr/lib/vmware/busybox/bin/busybox crond

The script will get a list of all VMs and re-run the cron creator in Vertical Backup to update the cron job.