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 bin/make_sqlite_tables
12 scripts/copy-tape-confs
14 echo "${cwd}/build" >/tmp/file-list
18 echo " === Starting four-jobs-tape ==="
19 echo " === Starting four-jobs-tape ===" >>working/log
22 bin/bacula start 2>&1 >/dev/null
23 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
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
37 # make some files for the incremental to pick up
38 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
39 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
44 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
48 run job=NightlySave level=Incremental yes
54 touch ${cwd}/build/src/dird/*.c
55 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
59 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
63 run job=NightlySave level=Incremental yes
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
85 # now do several restores to ensure we cleanup between jobs
87 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
89 restore where=${cwd}/tmp/bacula-restores select all
92 restore where=${cwd}/tmp/bacula-restores select all
96 restore where=${cwd}/tmp/bacula-restores select all
103 bin/bacula stop 2>&1 >/dev/null
104 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
106 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
108 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
109 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
112 echo " !!!!! four-jobs-tape Bacula source failed!!! !!!!! "
113 echo " !!!!! four-jobs-tape failed!!! !!!!! " >>test.out
116 echo " ===== four-jobs-tape Bacula source OK ===== "
117 echo " ===== four-jobs-tape OK ===== " >>test.out