Backing Up a Linux-based vCenter Virtual Machine

To back up a Linux-based vCenter virtual machine by using a backup job, you must first modify the VMware scripts pre-freeze-script and post-thaw-script on the vCenter virtual machine to avoid corrupted vCenter backups.

To modify the scripts, complete the following steps:

On the virtual machine, navigate to the /usr/sbin directory and replace the content of the script pre-freeze-script with the following content:

#!/bin/bash

#set log directory

log="/var/log/vpostgres_backup.log"

#set and log start date

today=`date +%Y\/%m\/%d\ %H:%M:%S`

echo "${today}: Start of creation consistent state" >> ${log}

#execute freeze command

cmd="echo \"SELECT pg_start_backup('${today}', true);\" | sudo /opt/vmware/vpostgres/9.4/bin/psql -U postgres >> ${log} 2>&1"

eval ${cmd}

#set and log end date

today=`date +%Y\/%m\/%d\ %H:%M:%S`

echo "${today}: Finished freeze script" >> ${log}

Replace the content of the script post-thaw-script with the following content:

#!/bin/bash

#set log directory

log="/var/log/vpostgres_backup.log"

#set and log start date

today=`date +%Y\/%m\/%d\ %H:%M:%S`

echo "${today}: Release of backup" >> ${log}

#execute release command

cmd="echo \"SELECT pg_stop_backup();\" | sudo /opt/vmware/vpostgres/9.4/bin/psql -U postgres >> ${log} 2>&1"

eval ${cmd}

#set and log end date

today=`date +%Y\/%m\/%d\ %H:%M:%S`

echo "${today}: Finished thaw script" >> ${log}

 


IBM Spectrum Protect Plus 10.1.2

Licensed Material - Property of IBM Corp. © IBM Corporation and other(s) 2018. IBM is a registered trademark of the IBM Corporation in the United States, other countries, or both. | 8/23/2018