moellerjot
Enthusiast
Enthusiast

Custom cronjob for vCD db-backup with vCD 10.3+ changes

Issue: New database backuptool in newer vCD Version 10.3+  -> /opt/vmware/appliance/bin/create-backup.sh

Custom Solution: 

# root cronjob usage on all Cells

 

0 7,19 * * * /opt/vmware/vcloud-director/data/transfer/mybackup.sh > /dev/null 2>&1

 

/opt/vmware/vcloud-director/data/transfer/mybackup.sh # location of transfert share

 

#!/bin/bash
#############################################
### vCD Backup Database 10.3+ by moellerj ###
#############################################
myhostname=`hostname|cut -d "." -f1` # if fqdn
# ident primary Cell
   getmaster=`sudo -i -u postgres /opt/vmware/vpostgres/current/bin/repmgr -f /opt/vmware/vpostgres/current/etc/repmgr.conf cluster show|grep "*" |cut -d "|" -f 2`

# If primary Cell exec 
if  [ $myhostname = $getmaster ] ; then
   /opt/vmware/appliance/bin/create-backup.sh
fi

 

somethingofnotsupported
# no backup no pity
# Copyleft

Labels (4)
Tags (2)
0 Kudos
0 Replies