3 # Run a simple backup of the Bacula build directory
4 # to a tape where the maximum tape file size is set to 1M
5 # then restore a few files from it.
8 bin/bacula stop 2>&1 >/dev/null
9 scripts/copy-tape-confs
11 echo "${cwd}/build" >/tmp/file-list
12 sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
13 bin/drop_sqlite_tables
14 bin/make_sqlite_tables
15 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
16 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
20 echo " === Starting restore-by-file-tape test ==="
21 echo " === Starting restore-by-file-tape test ===" >>working/log
24 bin/bacula start 2>&1 >/dev/null
25 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
29 label storage=DDS-4 volume=TestVolume001 slot=0
30 run job=NightlySave level=Full yes
37 restore where=${cwd}/tmp/bacula-restores
39 <${cwd}/tmp/restore2-list
49 # We need to stop and start Bacula to
50 # test appending to a previously written tape
52 bin/bacula stop 2>&1 >/dev/null
53 bin/bacula start 2>&1 >/dev/null
54 for i in `cat ${cwd}/tmp/restore2-list`; do
55 diff $i ${cwd}/tmp/bacula-restores$i
60 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
62 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
64 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
67 echo " !!!!! restore-by-file-tape test Bacula source failed!!! !!!!! "
68 echo " !!!!! restore-by-file-tape test failed!!! !!!!! " >>test.out
70 bin/bacula stop 2>&1 >/dev/null
73 rm -rf ${cwd}/tmp/bacula-restores
75 # Now do a second backup and restore
77 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
81 run job=NightlySave level=Full yes
88 restore where=${cwd}/tmp/bacula-restores
90 <${cwd}/tmp/restore2-list
98 bin/bacula stop 2>&1 >/dev/null
99 for i in `cat ${cwd}/tmp/restore2-list`; do
100 diff $i ${cwd}/tmp/bacula-restores$i
101 if [ $? != 0 ] ; then
105 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
107 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
109 if [ $dstat != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
112 echo " !!!!! restore-by-file-tape test Bacula source failed!!! !!!!! "
113 echo " !!!!! restore-by-file-tape test failed!!! !!!!! " >>test.out
116 echo " ===== restore-by-file-tape test Bacula source OK ===== "
117 echo " ===== restore-by-file-tape test OK ===== " >>test.out