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
40 # make some files for the incremental to pick up
41 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
42 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
47 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
51 run job=NightlySave level=Incremental yes
57 touch ${cwd}/build/src/dird/*.c
58 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
62 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
66 run job=NightlySave level=Incremental yes
72 # make some files for the incremental to pick up
73 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
77 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
81 run job=NightlySave level=Incremental yes
88 # now do several restores to ensure we cleanup between jobs
90 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
92 restore where=${cwd}/tmp/bacula-restores select all
95 restore where=${cwd}/tmp/bacula-restores select all
99 restore where=${cwd}/tmp/bacula-restores select all
106 bin/bacula stop 2>&1 >/dev/null
107 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
109 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
111 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
112 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
115 echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
116 echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
119 echo " ===== four-jobs-tape Bacula source OK ===== "
120 echo " ===== four-jobs-tape OK ===== " >>test.out