#!/bin/sh
#example fo postbackup
exit 0

set -e

ETCDIR=/etc/backup
CONFFILE=${ETCDIR}/backup.conf

if [ -f $CONFFILE ] ; then
  set +e
  source $CONFFILE || RET=$?
  set -e
else
  echo Kann Variablensettings nicht finden.
  exit
fi

REPOSIT=/var/lib/zope/instance/default/var/reposit
BACKUP=${RHOST}:${RDIR}/`hostname`_reposit

su ${NOVELLUSER} -c "rsync  -rlptDzuv -q --delete \
                      --exclude "*.undo" \
                      --exclude "old/" \
                      --exclude "undo/" \
                      ${REPOSIT} ${BACKUP}" || RET=$?

## Alternativ:
#rsync -rlptDzuv --delete -q \
#                      --exclude "*.undo" \
#                      --exclude "old/" \
#                      --exclude "undo/" \
#                       ${REPOSIT} ${NOVELLUSER}@${BACKUP} || RET=$?

# echo "RSYNC succeded (RET = ${RET})"
