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 ==="
19 echo " === Starting bscan-tape ===" >>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 label storage=DDS-4 volume=TestVolume001 slot=0
31 run job=NightlySave yes
33 run job=NightlySave level=Full yes
35 run job=NightlySave level=Full yes
40 scripts/check_for_zombie_jobs storage=DDS-4
42 # make some files for the incremental to pick up
43 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
44 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
49 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
53 run job=NightlySave level=Incremental yes
58 scripts/check_for_zombie_jobs storage=DDS-4
60 touch ${cwd}/build/src/dird/*.c
61 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
65 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
69 run job=NightlySave level=Incremental yes
74 scripts/check_for_zombie_jobs storage=DDS-4
76 # make some files for the incremental to pick up
77 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
78 #echo "abc" > ${cwd}/build/src/lib/dummy
82 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
86 run job=NightlySave level=Incremental yes
91 scripts/check_for_zombie_jobs storage=DDS-4
94 # now drop and recreate the database
97 ./drop_bacula_tables >/dev/null 2>&1
98 ./make_bacula_tables >/dev/null 2>&1
99 ./grant_bacula_privileges 2>&1 >/dev/null
102 bin/bacula stop 2>&1 >/dev/null
103 echo "volume=TestVolume001" >tmp/bscan.bsr
104 bin/bscan -w working -m -s -v -b tmp/bscan.bsr -c bin/bacula-sd.conf DDS-4 2>&1 >/dev/null
105 bin/bacula start 2>&1 >/dev/null
106 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
113 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
120 scripts/check_for_zombie_jobs storage=DDS-4
121 rm -f ${cwd}/build/src/lib/dummy
122 bin/bacula stop 2>&1 >/dev/null
123 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
125 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
127 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
128 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
131 echo " !!!!! bscan-tape Bacula source failed!!! !!!!! "
132 echo " !!!!! bscan-tape failed!!! !!!!! " >>test.out
135 echo " ===== bscan-tape Bacula source OK ===== "
136 echo " ===== bscan-tape OK ===== " >>test.out