3 # Run a simple backup of the Bacula build directory using the compressed option
4 # then backup four times, each with incremental then finally restore.
5 # It should require at least 4 different bsrs.
9 scripts/copy-tape-confs
11 echo "${cwd}/build" >/tmp/file-list
15 echo " === Starting four-jobs-tape ==="
16 echo " === Starting four-jobs-tape ===" >>working/log
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
22 estimate job=NightlySave listing
23 estimate job=NightlySave listing
24 estimate job=NightlySave listing
27 label storage=DDS-4 volume=TestVolume001 slot=0
28 run job=NightlySave yes
33 scripts/check_for_zombie_jobs storage=DDS-4
35 # make some files for the incremental to pick up
36 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
37 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
42 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
46 run job=NightlySave level=Incremental yes
51 scripts/check_for_zombie_jobs storage=DDS-4
53 touch ${cwd}/build/src/dird/*.c
54 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
58 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
62 run job=NightlySave level=Incremental yes
67 scripts/check_for_zombie_jobs storage=DDS-4
69 # make some files for the incremental to pick up
70 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
74 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
78 run job=NightlySave level=Incremental yes
83 scripts/check_for_zombie_jobs storage=DDS-4
86 # now do several restores to ensure we cleanup between jobs
88 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
90 restore where=${cwd}/tmp/bacula-restores select all done
93 restore where=${cwd}/tmp/bacula-restores select all done
98 @# now unmount the tape and start two restores
101 unmount storage=DDS-4
102 restore where=${cwd}/tmp/bacula-restores select all done
104 restore where=${cwd}/tmp/bacula-restores select
115 bin/bacula stop 2>&1 >/dev/null
116 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
118 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
120 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
121 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
124 echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
125 echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
128 echo " ===== four-jobs-tape Bacula source OK ===== "
129 echo " ===== four-jobs-tape OK ===== " >>test.out