3 # Run a simple backup of the Bacula build directory using the compressed option
4 # then restore a few selected files.
7 scripts/copy-test-confs
9 echo "${cwd}/build" >/tmp/file-list
10 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
11 bin/bacula stop 2>&1 >/dev/null
13 ./drop_bacula_tables >/dev/null 2>&1
14 ./make_bacula_tables >/dev/null 2>&1
15 ./grant_bacula_privileges 2>&1 >/dev/null
20 echo " === Starting restore2-by-file-test ==="
21 echo " === Starting restore2-by-file-test ===" >>working/log
24 bin/bacula start 2>&1 >/dev/null
25 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
29 label storage=File volume=TestVolume001
30 run job=CompressedTest yes
37 restore where=${cwd}/tmp/bacula-restores
39 <${cwd}/tmp/restore2-list
47 bin/bacula stop 2>&1 >/dev/null
48 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
50 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
53 for i in `cat ${cwd}/tmp/restore2-list`; do
54 diff $i ${cwd}/tmp/bacula-restores$i
59 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
62 echo " !!!!! restore2-by-file-test Bacula source failed!!! !!!!! "
63 echo " !!!!! restore2-by-file-test failed!!! !!!!! " >>test.out
65 echo "Backup term status = $bstat"
66 echo "Restore term status = $rstat"
67 echo "Diff status = $dstat"
70 echo " ===== restore2-by-file-test Bacula source OK ===== "
71 echo " ===== restore2-by-file-test OK ===== " >>test.out