#!/bin/sh # # Run a simple backup of the Bacula build directory # then restore it. # MUID=`/usr/bin/id -u` if [ $MUID != 0 ] ; then echo " " echo "You must be root to run this test." echo " ===== etc-test-root failed!!! ===== " echo " ===== etc-test-root failed!!! ===== " >>test.out echo " " exit 1 fi echo " " echo " " echo " === Starting /etc save/restore test ===" echo " " echo " " cwd=`pwd` scripts/copy-test-confs scripts/cleanup echo "/etc" >/tmp/file-list bin/bacula stop 2>&1 >/dev/null bin/drop_sqlite_tables bin/make_sqlite_tables bin/bacula start 2>&1 >/dev/null bin/console -c bin/console.conf <&1 >/dev/null cd / ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1 cd ${cwd}/tmp/bacula-restores ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2 sort <${cwd}/tmp/1 >${cwd}/tmp/original sort <${cwd}/tmp/2 >${cwd}/tmp/restored rm -f ${cwd}/tmp/1 ${cwd}/tmp/2 cd ${cwd} diff tmp/original tmp/restored 2>&1 1>/dev/null if [ $? != 0 ] ; then echo " " echo " " echo " ===== etc-test-root failed!!! ===== " echo " ===== etc-test-root failed!!! ===== " >>test.out echo " " else echo " ===== etc-test-root OK ===== " echo " ===== etc-test-root OK ===== " >>test.out scripts/cleanup fi