3 # Run a simple backup of the Bacula build directory
7 if [ $MUID != 0 ] ; then
9 echo "You must be root to run this test."
10 echo " ===== etc-test-root failed!!! ===== "
11 echo " ===== etc-test-root failed!!! ===== " >>test.out
17 echo " === Starting /etc save/restore test ==="
21 scripts/copy-test-confs
23 echo "/etc" >/tmp/file-list
24 bin/bacula stop 2>&1 >/dev/null
25 bin/drop_sqlite_tables
26 bin/make_sqlite_tables
27 bin/bacula start 2>&1 >/dev/null
28 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
42 restore where=${cwd}/tmp/bacula-restores select all
49 bin/bacula stop 2>&1 >/dev/null
51 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1
52 cd ${cwd}/tmp/bacula-restores
53 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
54 sort <${cwd}/tmp/1 >${cwd}/tmp/original
55 sort <${cwd}/tmp/2 >${cwd}/tmp/restored
56 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
58 diff tmp/original tmp/restored 2>&1 1>/dev/null
62 echo " ===== etc-test-root failed!!! ===== "
63 echo " ===== etc-test-root failed!!! ===== " >>test.out
66 echo " ===== etc-test-root OK ===== "
67 echo " ===== etc-test-root OK ===== " >>test.out