#
# Run two jobs at the same time
#
+debug=0
+if test "$debug" -eq 1 ; then
+ out="tee"
+else
+ out="output"
+fi
+
cwd=`pwd`
-bin/bacula stop 2>&1 >/dev/null
-bin/drop_sqlite_tables
-bin/make_sqlite_tables
scripts/copy-tape-confs
scripts/cleanup-tape
+
echo "${cwd}/build" >/tmp/file-list
echo " "
echo " "
-echo " === Starting four-concurent-jobs-tape ==="
-echo " === Starting four-concurent-jobs-tape ===" >>working/log
+echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ==="
+echo " === Starting four-concurrent-jobs-tape at `date +%R:%S` ===" >>working/log
echo " "
-#bin/bacula start 2>&1 >/dev/null
-bin/bacula start
-bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
-@output /dev/null
+cat <<END_OF_DATA >tmp/bconcmds
+@$out /dev/null
messages
-@output tmp/log1.out
-label storage=DDS-4 volume=TestVolume001 slot=0
+@$out tmp/log1.out
+label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
run job=NightlySave level=Full Storage=DDS-4 yes
run job=NightlySave level=Full Storage=DDS-4 yes
run job=NightlySave level=Full Storage=DDS-4 yes
@#
@# now do a restore
@#
-@output tmp/log2.out
-restore where=${cwd}/tmp/bacula-restores select all
+@$out tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
+unmark *
+mark *
+done
yes
wait
messages
-@output
+@$out
quit
END_OF_DATA
+if test "$debug" -eq 1 ; then
+ bin/bacula start
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
+else
+ bin/bacula start 2>&1 >/dev/null
+ cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
+fi
+scripts/check_for_zombie_jobs storage=DDS-4
bin/bacula stop 2>&1 >/dev/null
-grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
+grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
bstat=$?
-grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
+grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
rstat=$?
diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
echo " "
echo " "
- echo " !!!!! four-concurent-jobs-tape Bacula source failed!!! !!!!! "
- echo " !!!!! four-concurent-jobs-tape failed!!! !!!!! " >>test.out
+ echo " !!!!! four-concurrent-jobs-tape Bacula source failed!!! !!!!! "
+ echo " !!!!! four-concurrent-jobs-tape failed!!! !!!!! " >>test.out
echo " "
exit 1
else
- echo " ===== four-concurent-jobs-tape Bacula source OK ===== "
- echo " ===== four-concurent-jobs-tape OK ===== " >>test.out
+ echo " ===== four-concurrent-jobs-tape Bacula source OK ===== "
+ echo " ===== four-concurrent-jobs-tape OK ===== " >>test.out
scripts/cleanup
exit 0
fi