mv bin/bacula-dir.conf bin/1
echo "s%${oldname}%${newname}%g" >/tmp/1
sed -f /tmp/1 bin/1 >bin/bacula-dir.conf
- echo "Job ${oldname} changed to ${newname}"
+# echo "Job ${oldname} changed to ${newname}"
}
check_two_logs()
run_bconsole
check_for_zombie_jobs storage=File
-bacula_stop
+stop_bacula
check_two_logs
check_restore_diff
. scripts/functions
set_debug 0
-scripts/copy-tape-confs
-scripts/cleanup-tape
+copy_tape_confs
+
echo "${cwd}/tmp/build" >/tmp/file-list
if test ! -d ${cwd}/tmp/build ; then
mkdir ${cwd}/tmp/build
echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
cd ${cwd}
-change_jobname $JobName
+change_jobname NightlySave $JobName
start_test
cat <<END_OF_DATA >tmp/bconcmds
quit
END_OF_DATA
-scripts/check_for_zombie_jobs storage=DDS-4
+run_bacula
+check_for_zombie_jobs storage=DDS-4
echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
quit
END_OF_DATA
-run_bacula
+run_bconsole
check_for_zombie_jobs storage=DDS-4
stop_bacula
JobName=restorebyfile
. scripts/functions
set_debug 0
+copy_tape_confs
-scripts/copy-tape-confs
-scripts/cleanup-tape
echo "${cwd}/build" >/tmp/file-list
sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-change_jobname $JobName
+change_jobname NightlySave $JobName
start_test
cat <<END_OF_DATA >tmp/bconcmds
check_for_zombie_jobs storage=DDS-4
stop_bacula
-check_two_logs
-
dstat=0
#
# We need to stop and start Bacula to
fi
done
-end_test
-
cat <<END_OF_DATA >tmp/bconcmds
@output /dev/null
messages
dstat=1
fi
done
+
end_test
JobName=restore2byfile
. scripts/functions
set_debug 0
+copy_test_confs
-cwd=`pwd`
-scripts/copy-test-confs
-scripts/cleanup
echo "${cwd}/build" >/tmp/file-list
sed s%\^%${cwd}% ${cwd}/scripts/flist >${cwd}/tmp/restore2-list
. scripts/functions
set_debug 0
-scripts/copy-tape-confs
-scripts/cleanup-tape
+copy_tape_confs
echo "${cwd}/build" >/tmp/file-list
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
-change_jobname $JobName
+change_jobname NightlySave $JobName
start_test
cat <<END_OF_DATA >tmp/bconcmds
@output /dev/null
messages
-@$out t tmp/log1.out
+@$out tmp/log1.out
label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
setdebug level=2 storage=DDS-4
run job=$JobName yes
JobName=truncatebug
. scripts/functions
set_debug 0
+copy_tape_confs
-scripts/copy-tape-confs
-scripts/cleanup-tape
echo "${cwd}/build" >/tmp/file-list
-change_jobname $JobName
+change_jobname NightlySave $JobName
start_test
cat <<END_OF_DATA >tmp/bconcmds
@$out tmp/log1.out
label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
@# do a bunch of saves so we have 12 files on the tape
-run job=NightlySave yes
+run job=$JobName yes
run level=Full job=$JobName yes
run level=Full job=$JobName yes
run level=Full job=$JobName yes
cat <<END_OF_DATA >tmp/bconcmds
@output /dev/null
messages
-@$out tmp/log1.out
+@$out tmp/log2.out
@#
@# now do a restore
@#
run_bconsole
scripts/check_for_zombie_jobs storage=DDS-4
+# Now write to tape one more time
cat <<END_OF_DATA >tmp/bconcmds
@output /dev/null
messages
-@$out tmp/log2.out
+@$out tmp/log3.out
run level=Full job=$JobName yes
wait
messages
quit
END_OF_DATA
-bin/bacula stop 2>&1 >/dev/null
run_bconsole
check_for_zombie_jobs storage=DDS-4
stop_bacula
check_two_logs
-# no diff made
-dstat=0
+grep "^ Termination: *Backup OK" tmp/log3.out 2>&1 >/dev/null
+dstat=$?
end_test
-