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
26 ./drop_bacula_tables >/dev/null 2>&1
27 ./make_bacula_tables >/dev/null 2>&1
28 ./grant_bacula_privileges 2>&1 >/dev/null
30 bin/bacula start 2>&1 >/dev/null
31 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
45 restore where=${cwd}/tmp/bacula-restores select
55 bin/bacula stop 2>&1 >/dev/null
57 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1
58 cd ${cwd}/tmp/bacula-restores
59 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
60 sort <${cwd}/tmp/1 >${cwd}/tmp/original
61 sort <${cwd}/tmp/2 >${cwd}/tmp/restored
62 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
64 diff tmp/original tmp/restored 2>&1 1>/dev/null
68 echo " ===== etc-test-root failed!!! ===== "
69 echo " ===== etc-test-root failed!!! ===== " >>test.out
72 echo " ===== etc-test-root OK ===== "
73 echo " ===== etc-test-root OK ===== " >>test.out