User Tools

Site Tools


backup_vmware

This is an old revision of the document!


How to make backups in VMware using ghettoVCB.sh and crontab

Install ghettoVCB

Download latest files from github: https://github.com/lamw/ghettoVCB Put the files on a datastore. I use datastore backup (/vmfs/volumes/backup), which is an NFS mount. I have put the original scripts in /vmfs/volumes/backup/bin. I have create my own cron script to put the backup files in the necessary directories.

/vmfs/volumes/backup/cron-ghettoVCB.sh
#!/bin/sh
BACKUPDIR=/vmfs/volumes/backup
BINDIR=$BACKUPDIR/bin
CONFDIR=$BACKUPDIR/conf
LOGDIR=$BACKUPDIR/log
DATE=$(date +%d-%m-%Y-%H-%M)
HOSTNAME=$(hostname)

case $(hostname -d) in
  mngt.bh.helux.nl) DOMAIN=bh ;;
  mngt.rtd.helux.nl) DOMAIN=rtd ;;
  mngt.ams.helux.nl) DOMAIN=ams ;;
  *) DOMAIN=unknown ;;
esac

$BINDIR/ghettoVCB.sh -a -g $CONFDIR/ghettoVCB-$DOMAIN.conf -l $LOGDIR/$HOSTNAME-$DATE.log >/dev/null 2>&1

exit 0

Configure ghettoVCB

Configure crontab

Add the following on each ESXi hypervisor. The notation of the crontab is as follows:

#min hour day mon dow command

using the following config it means. run on 1:00 on sunday (day 0)

/etc/rc.local.d/local.sh
.
.
/bin/kill $(cat /var/run/crond.pid)
/bin/echo "0    1    *   *   0   /vmfs/volumes/backup/cron-ghettoVCB.sh" >> /var/spool/cron/crontabs/root
crond
exit 0
backup_vmware.1430845289.txt.gz · Last modified: by herwarth