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
14 echo " === Starting restore2-by-file-test at `date +%R:%S` ==="
15 echo " === Starting restore2-by-file-test at `date +%R:%S` ===" >>working/log
18 bin/bacula start 2>&1 >/dev/null
19 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
23 label storage=File volume=TestVolume001
24 run job=CompressedTest yes
31 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore2-list
38 scripts/check_for_zombie_jobs storage=File
39 bin/bacula stop 2>&1 >/dev/null
40 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
42 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
45 for i in `cat ${cwd}/tmp/restore2-list`; do
46 diff $i ${cwd}/tmp/bacula-restores$i
51 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
54 echo " !!!!! restore2-by-file-test Bacula source failed!!! !!!!! "
55 echo " !!!!! restore2-by-file-test failed!!! !!!!! " >>test.out
57 echo "Backup term status = $bstat"
58 echo "Restore term status = $rstat"
59 echo "Diff status = $dstat"
62 echo " ===== restore2-by-file-test Bacula source OK `date +%R:%S` ===== "
63 echo " ===== restore2-by-file-test OK `date +%R:%S` ===== " >>test.out