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 scripts/copy-tape-confs
11 echo "${cwd}/build" >/tmp/file-list
13 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
14 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
18 echo " === Starting bscan-tape at `date +%R:%S` ==="
19 echo " === Starting bscan-tape at `date +%R:%S` ===" >>working/log
22 bin/bacula start 2>&1 >/dev/null
23 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
25 estimate job=NightlySave listing
26 estimate job=NightlySave listing
27 estimate job=NightlySave listing
30 setdebug level=2 storage=DDS-4
31 label storage=DDS-4 volume=TestVolume001 slot=0
32 run job=NightlySave yes
34 run job=NightlySave level=Full yes
36 run job=NightlySave level=Full yes
41 scripts/check_for_zombie_jobs storage=DDS-4
43 # make some files for the incremental to pick up
44 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
45 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
50 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
54 run job=NightlySave level=Incremental yes
59 scripts/check_for_zombie_jobs storage=DDS-4
61 touch ${cwd}/build/src/dird/*.c
62 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
66 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
70 run job=NightlySave level=Incremental yes
75 scripts/check_for_zombie_jobs storage=DDS-4
77 # make some files for the incremental to pick up
78 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
79 #echo "abc" > ${cwd}/build/src/lib/dummy
83 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
87 run job=NightlySave level=Incremental yes
92 scripts/check_for_zombie_jobs storage=DDS-4
95 # now drop and recreate the database
98 ./drop_bacula_tables >/dev/null 2>&1
99 ./make_bacula_tables >/dev/null 2>&1
100 ./grant_bacula_privileges 2>&1 >/dev/null
103 bin/bacula stop 2>&1 >/dev/null
104 echo "volume=TestVolume001" >tmp/bscan.bsr
105 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
106 bin/bacula start 2>&1 >/dev/null
107 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
114 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
121 scripts/check_for_zombie_jobs storage=DDS-4
122 rm -f ${cwd}/build/src/lib/dummy
123 bin/bacula stop 2>&1 >/dev/null
124 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
126 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
128 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
129 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
132 echo " !!!!! bscan-tape Bacula source failed!!! !!!!! "
133 echo " !!!!! bscan-tape failed!!! !!!!! " >>test.out
136 echo " ===== bscan-tape Bacula source OK ===== "
137 echo " ===== bscan-tape OK ===== " >>test.out