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.
8 bin/bacula stop 2>&1 >/dev/null
10 ./drop_bacula_tables >/dev/null 2>&1
11 ./make_bacula_tables >/dev/null 2>&1
12 ./grant_bacula_privileges 2>&1 >/dev/null
15 scripts/copy-tape-confs
17 echo "${cwd}/build" >/tmp/file-list
21 echo " === Starting four-jobs-tape ==="
22 echo " === Starting four-jobs-tape ===" >>working/log
25 bin/bacula start 2>&1 >/dev/null
26 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
28 estimate job=NightlySave listing
29 estimate job=NightlySave listing
30 estimate job=NightlySave listing
33 label storage=DDS-4 volume=TestVolume001 slot=0
34 run job=NightlySave yes
39 scripts/check_for_zombie_jobs storage=DDS-4
41 # make some files for the incremental to pick up
42 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
43 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
48 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
52 run job=NightlySave level=Incremental yes
57 scripts/check_for_zombie_jobs storage=DDS-4
59 touch ${cwd}/build/src/dird/*.c
60 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
64 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
68 run job=NightlySave level=Incremental yes
73 scripts/check_for_zombie_jobs storage=DDS-4
75 # make some files for the incremental to pick up
76 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
80 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
84 run job=NightlySave level=Incremental yes
89 scripts/check_for_zombie_jobs storage=DDS-4
92 # now do several restores to ensure we cleanup between jobs
94 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
96 restore where=${cwd}/tmp/bacula-restores select all done
99 restore where=${cwd}/tmp/bacula-restores select all done
104 @# now unmount the tape and start two restores
107 unmount storage=DDS-4
108 restore where=${cwd}/tmp/bacula-restores select all done
110 restore where=${cwd}/tmp/bacula-restores select
121 bin/bacula stop 2>&1 >/dev/null
122 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
124 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
126 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
127 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
130 echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
131 echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
134 echo " ===== four-jobs-tape Bacula source OK ===== "
135 echo " ===== four-jobs-tape OK ===== " >>test.out