This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| backup_vmware [2015/05/05 17:18] – herwarth | backup_vmware [2015/05/05 17:44] (current) – herwarth | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| Put the files on a datastore. I use datastore backup (/ | Put the files on a datastore. I use datastore backup (/ | ||
| I have put the original scripts in / | I have put the original scripts in / | ||
| + | |||
| From download machine: | From download machine: | ||
| scp ghettoVCB-master.zip root@supermicro1.mngt.bh.helux.nl:/ | scp ghettoVCB-master.zip root@supermicro1.mngt.bh.helux.nl:/ | ||
| Line 143: | Line 144: | ||
| crond | crond | ||
| exit 0 | exit 0 | ||
| + | </ | ||
| + | |||
| + | after that run it for 1 time only! | ||
| + | |||
| + | / | ||
| + | |||
| + | make it persistent | ||
| + | |||
| + | / | ||
| + | |||
| + | =====Use Bacula to backup the NFS share===== | ||
| + | We only backup vms backupped with status OK. So I use a script before I run the Bacula job. | ||
| + | This script is the same NFS share on Linux as a datastore on the hypervisor. In this situation the NFS share is mounted on / | ||
| + | |||
| + | <code - run-before-bacula.sh> | ||
| + | #!/bin/bash | ||
| + | BACKUPDIR=/ | ||
| + | STATUSOK=STATUS.ok | ||
| + | STATUSWARN=STATUS.warn | ||
| + | TEMPDIR=$BACKUPDIR/ | ||
| + | |||
| + | case $1 in | ||
| + | bh) DATADIR=$BACKUPDIR/ | ||
| + | rtd) DATADIR=$BACKUPDIR/ | ||
| + | ams) DATADIR=$BACKUPDIR/ | ||
| + | *) echo "usage $0 < | ||
| + | exit 1 ;; | ||
| + | esac | ||
| + | |||
| + | rm -rf $TEMPDIR/* | ||
| + | |||
| + | for fulldir in $(find $DATADIR -name $STATUSOK -exec dirname {} \; -o -name $STATUSWARN -exec dirname {} \; ); do | ||
| + | DIR=$(basename $fulldir) | ||
| + | VMNAME=$(echo $fulldir | sed " | ||
| + | if [ ! -d $TEMPDIR/ | ||
| + | mkdir $TEMPDIR/ | ||
| + | fi | ||
| + | mv $fulldir $TEMPDIR/ | ||
| + | done | ||
| + | |||
| + | rm -rf $DATADIR/* | ||
| + | mv $TEMPDIR/* $DATADIR | ||
| </ | </ | ||