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
12 bin/drop_sqlite_tables
13 bin/make_sqlite_tables
17 echo " === Starting restore2-by-file-test ==="
18 echo " === Starting restore2-by-file-test ===" >>working/log
21 bin/bacula start 2>&1 >/dev/null
22 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
26 label storage=File volume=TestVolume001
27 run job=CompressedTest yes
34 restore where=${cwd}/tmp/bacula-restores
36 <${cwd}/tmp/restore2-list
44 bin/bacula stop 2>&1 >/dev/null
45 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
47 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
50 for i in `cat ${cwd}/tmp/restore2-list`; do
51 diff $i ${cwd}/tmp/bacula-restores$i
56 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
59 echo " !!!!! restore2-by-file-test Bacula source failed!!! !!!!! "
60 echo " !!!!! restore2-by-file-test failed!!! !!!!! " >>test.out
62 echo "Backup term status = $bstat"
63 echo "Restore term status = $rstat"
64 echo "Diff status = $dstat"
67 echo " ===== restore2-by-file-test Bacula source OK ===== "
68 echo " ===== restore2-by-file-test OK ===== " >>test.out