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 all
52 bin/bacula stop 2>&1 >/dev/null
54 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/1
55 cd ${cwd}/tmp/bacula-restores
56 ${cwd}/bin/testls -e ${cwd}/scripts/exclude-etc-test etc >${cwd}/tmp/2
57 sort <${cwd}/tmp/1 >${cwd}/tmp/original
58 sort <${cwd}/tmp/2 >${cwd}/tmp/restored
59 rm -f ${cwd}/tmp/1 ${cwd}/tmp/2
61 diff tmp/original tmp/restored 2>&1 1>/dev/null
65 echo " ===== etc-test-root failed!!! ===== "
66 echo " ===== etc-test-root failed!!! ===== " >>test.out
69 echo " ===== etc-test-root OK ===== "
70 echo " ===== etc-test-root OK ===== " >>test.out