Virtual Machine Backup in VMWare

Description : Here I have describe how to take Virtual Machine backup using shell script

Procedure :

  • Download  script from below URL:

https://github.com/lamw/ghettoVCB

  • Upload it in server  using winscp
  •  Login ssh console using putty
  • Go to  location where you have copy  extracted folder [ghettoVCB-master]
  • Give execute permission to  ghettoVCB.sh file using below command

# chmod +x ghettoVCB.sh

  • Create one file name vmbackup where write all vm name  like as follow:

VM1

VM2
VM3
  • Open ghettoVCB.sh file and make changes as follow: 

VM_BACKUP_VOLUME=/vmfs/volumes/596d4786-c3022a80-2c0b-843dc6ec482a/Backup/vmbackup    ### Backup Location ####


VM_BACKUP_ROTATION_COUNT=2    ### Backup Retention File ###
  • Run below command to start backup

# ./ghettoVCB.sh -f vmbackup

  • To set cron job in VMWare open  /var/spool/cron/crontabs/root file

30   4    *   *   6   /bin/sh /vmfs/volumes/596d4786-c3022a80-2c0b-843dc6ec482a/Backup/ghettoVCB-master/ghettoVCB.sh -f  /vmfs/volumes/596d4786-c3022a80-2c0b-843dc6ec482a/Backup/ghettoVCB-master/vmbackup 


Note: In example I have set backup at every saturday 4:30 AM backup

Leave a comment