#! /bin/bash # Roderick Derks # www.r71.nl # 20061226 # # backup vmware's virtual machines to a remote computer # 1. check if backupserver is running # 2. stop the vm's that are running # 3. local copy the vm files # 4. start only the vm's that were running # 5. remote copy of the backup created in step 3 ######################################## ### day and hour ################################################################### echo $HOSTNAME > ${LOGFILE} # flush logfile and add data ################################ IFS=$'n' # needed to prevent problems with filenames containing spaces in arrays #echo count to 30 ## echo >> ${LOGFILE}; echo # Local rsync copy command (to a local disk) echo Local backup finished >> ${LOGFILE}; echo; echo Local backup finished. ## #echo "Elements in array0: ${array0[@]}" for VM in ${array0[@]} # check if remote server is up using return value: 1 is failed (down), 0 is success (up) ping ${VM_HOST_REMOTE_DEST} -c2|grep -q " 0% packet loss" # Copy local backup to a remote server. else echo "wait until the mailserver is running so a report can be send." ## echo >> ${LOGFILE} exit 0 |
Leave a Reply