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 if test "$debug" -eq 1 ; then
14 scripts/copy-tape-confs
16 echo "${cwd}/build" >/tmp/file-list
20 echo " === Starting four-jobs-tape at `date +%R:%S` ==="
21 echo " === Starting four-jobs-tape at `date +%R:%S` ===" >>working/log
24 cat <<END_OF_DATA >tmp/bconcmds
26 estimate job=NightlySave listing
27 estimate job=NightlySave listing
28 estimate job=NightlySave listing
31 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
32 run job=NightlySave yes
37 if test "$debug" -eq 1 ; then
39 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
41 bin/bacula start 2>&1 >/dev/null
42 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
45 scripts/check_for_zombie_jobs storage=DDS-4
47 # make some files for the incremental to pick up
48 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
49 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
54 cat <<END_OF_DATA >tmp/bconcmds
58 run job=NightlySave level=Incremental yes
63 if test "$debug" -eq 1 ; then
65 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
67 bin/bacula start 2>&1 >/dev/null
68 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
71 scripts/check_for_zombie_jobs storage=DDS-4
73 touch ${cwd}/build/src/dird/*.c
74 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
78 cat <<END_OF_DATA >tmp/bconcmds
82 run job=NightlySave level=Incremental yes
87 if test "$debug" -eq 1 ; then
89 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
91 bin/bacula start 2>&1 >/dev/null
92 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
95 scripts/check_for_zombie_jobs storage=DDS-4
97 # make some files for the incremental to pick up
98 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
102 cat <<END_OF_DATA >tmp/bconcmds
106 run job=NightlySave level=Incremental yes
111 if test "$debug" -eq 1 ; then
113 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
115 bin/bacula start 2>&1 >/dev/null
116 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
119 scripts/check_for_zombie_jobs storage=DDS-4
122 # now do several restores to ensure we cleanup between jobs
124 cat <<END_OF_DATA >tmp/bconcmds
126 restore where=${cwd}/tmp/bacula-restores select all done
129 restore where=${cwd}/tmp/bacula-restores select all done
134 @# now unmount the tape and start two restores
137 unmount storage=DDS-4
138 restore where=${cwd}/tmp/bacula-restores select all done
140 restore where=${cwd}/tmp/bacula-restores select
151 if test "$debug" -eq 1 ; then
153 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
155 bin/bacula start 2>&1 >/dev/null
156 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
159 bin/bacula stop 2>&1 >/dev/null
160 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
162 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
164 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
165 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
168 echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
169 echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
172 echo " ===== four-jobs-tape Bacula source OK ===== "
173 echo " ===== four-jobs-tape OK ===== " >>test.out