3 # Run a simple backup of the Bacula build directory using the compressed option
4 # then backup four times, each with incremental then
5 # do a bscan and restore.
6 # It should require at least 4 different bsrs.
9 if test "$debug" -eq 1 ; then
16 scripts/copy-tape-confs
18 echo "${cwd}/build" >/tmp/file-list
20 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
21 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
25 echo " === Starting bscan-tape at `date +%R:%S` ==="
26 echo " === Starting bscan-tape at `date +%R:%S` ===" >>working/log
29 cat <<END_OF_DATA >tmp/bconcmds
31 estimate job=NightlySave listing
32 estimate job=NightlySave listing
33 estimate job=NightlySave listing
36 setdebug level=2 storage=DDS-4
37 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
38 run job=NightlySave yes
40 run job=NightlySave level=Full yes
42 run job=NightlySave level=Full yes
48 if test "$debug" -eq 1 ; then
50 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
52 bin/bacula start 2>&1 >/dev/null
53 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
55 scripts/check_for_zombie_jobs storage=DDS-4
57 # make some files for the incremental to pick up
58 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
59 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
64 cat <<END_OF_DATA >tmp/bconcmds
68 run job=NightlySave level=Incremental yes
73 if test "$debug" -eq 1 ; then
75 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
77 bin/bacula start 2>&1 >/dev/null
78 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
81 scripts/check_for_zombie_jobs storage=DDS-4
83 touch ${cwd}/build/src/dird/*.c
84 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
88 cat <<END_OF_DATA >tmp/bconcmds
92 run job=NightlySave level=Incremental yes
97 if test "$debug" -eq 1 ; then
99 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
101 bin/bacula start 2>&1 >/dev/null
102 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
105 scripts/check_for_zombie_jobs storage=DDS-4
107 # make some files for the incremental to pick up
108 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
109 #echo "abc" > ${cwd}/build/src/lib/dummy
114 cat <<END_OF_DATA >tmp/bconcmds
118 run job=NightlySave level=Incremental yes
123 if test "$debug" -eq 1 ; then
125 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
127 bin/bacula start 2>&1 >/dev/null
128 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
131 scripts/check_for_zombie_jobs storage=DDS-4
134 # now drop and recreate the database
137 ./drop_bacula_tables >/dev/null 2>&1
138 ./make_bacula_tables >/dev/null 2>&1
139 ./grant_bacula_privileges 2>&1 >/dev/null
142 bin/bacula stop 2>&1 >/dev/null
143 echo "volume=TestVolume001" >tmp/bscan.bsr
144 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
145 bin/bacula start 2>&1 >/dev/null
146 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
153 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
160 scripts/check_for_zombie_jobs storage=DDS-4
161 rm -f ${cwd}/build/src/lib/dummy
162 bin/bacula stop 2>&1 >/dev/null
163 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
165 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
167 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
168 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
171 echo " !!!!! bscan-tape Bacula source failed!!! !!!!! "
172 echo " !!!!! bscan-tape failed!!! !!!!! " >>test.out
175 echo " ===== bscan-tape Bacula source OK ===== "
176 echo " ===== bscan-tape OK ===== " >>test.out