--- /dev/null
+#!/bin/sh
+#
+# Create fresh virtual disk changer directory
+#
+rm -rf tmp/disk-changer
+mkdir tmp/disk-changer
+# Create 10 slots
+for i in 1 2 3 4 5 6 7 8 9 10 ; do
+ touch tmp/disk-changer/slot$i
+done
+++ /dev/null
-#!/bin/sh
-#
-# Create fresh virtual disk changer directory
-#
-rm -rf tmp/disk-changer
-mkdir tmp/disk-changer
-# Create 10 slots
-for i in 1 2 3 4 5 6 7 8 9 10 ; do
- touch tmp/disk-changer/slot$i
-done
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
echo "${cwd}/build" >${cwd}/tmp/file-list
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
echo "${cwd}/build" >${cwd}/tmp/file-list
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
change_jobname localhost-fd $JobName
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
# Make a relatively large backup set 5 x source code directory
# Reduced to 1 for portable
cd ..
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
if test ! -d ${cwd}/tmp/build ; then
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname $JobName
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/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
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname NightlySave $JobName
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/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
cwd=`pwd`
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
cwd=`pwd`
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
# remove Client Run Before Job
cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk
echo "${cwd}/build" >${cwd}/tmp/file-list
cwd=`pwd`
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
# Make a relatively large backup set 5 x source code directory
# Reduced to 1 for portable
cwd=`pwd`
scripts/cleanup
scripts/copy-2disk-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
echo "${cwd}/build" >${cwd}/tmp/file-list
change_jobname NightlySave $JobName
list jobs
list volumes
@#
-@# now do a restore
+@# now do a normal restore of normal backups
@#
@$out ${cwd}/tmp/log2.out
restore where=${cwd}/tmp/bacula-restores select
list volumes
list jobs
@#
-@# now do a restore
+@# now do a restore of the consolidated Full
@#
@$out ${cwd}/tmp/log2.out
restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
done
yes
wait
-update Volume=ChangerVolume002
-11
-Default
-list volumes
-list jobs
-messages
-@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
-run job=$JobName level=Incremental yes
-wait
-messages
-list jobs
-list volumes
-@# Now do another Consolidation
-setdebug level=150 storage=DiskChanger
-run job=$JobName level=VirtualFull yes
-wait
-messages
-list volumes
-list jobs
-@#
-@# now do a restore
-@#
-@$out ${cwd}/tmp/log2.out
-setdebug level=0 storage=DiskChanger
-restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
-unmark *
-mark *
-done
-yes
-wait
list volumes
list jobs
messages
--- /dev/null
+#!/bin/sh
+#
+# Run a simple backup of the Bacula build directory then do a virtual
+# backup to another device.
+#
+# This script uses the virtual disk autochanger
+#
+TestName="virtual-backup-test"
+JobName=Vbackup
+. scripts/functions
+
+
+scripts/cleanup
+scripts/copy-migration-confs
+scripts/prepare-disk-changer
+echo "${cwd}/build" >${cwd}/tmp/file-list
+
+change_jobname NightlySave $JobName
+start_test
+
+#
+# Note, we first backup into Pool Default,
+# then Migrate into Pool Full.
+# Pool Default forced to use Storage=DiskChanger
+# Pool Full uses Storage=DiskChanger
+
+# Write out bconsole commands
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output
+messages
+@$out ${cwd}/tmp/log1.out
+setdebug level=150 storage=DiskChanger
+label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
+label storage=DiskChanger volume=ChangerVolume003 slot=3 Pool=Full drive=0
+setdebug level=0 storage=DiskChanger
+@# run several jobs
+run job=$JobName level=Full yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
+run job=$JobName level=Incremental storage=DiskChanger yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
+run job=$JobName level=Differential storage=DiskChanger yes
+wait
+messages
+list jobs
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
+run job=$JobName level=Incremental storage=DiskChanger yes
+wait
+messages
+list jobs
+list volumes
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select
+unmark *
+mark *
+done
+yes
+list volumes
+@#setdebug level=100 dir
+@# should Consolidate Full, Differential and Incremental
+@#setdebug level=51 storage=DiskChanger
+run job=$JobName level=VirtualFull storage=DiskChanger yes
+wait
+messages
+list volumes
+list jobs
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+update Volume=ChangerVolume002
+11
+Default
+list volumes
+list jobs
+messages
+@exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
+run job=$JobName level=Incremental storage=DiskChanger yes
+wait
+messages
+list jobs
+list volumes
+@# Now do another Consolidation
+setdebug level=150 storage=DiskChanger
+run job=$JobName level=VirtualFull storage=DiskChanger yes
+wait
+messages
+list volumes
+list jobs
+@#
+@# now do a restore
+@#
+@$out ${cwd}/tmp/log2.out
+setdebug level=0 storage=DiskChanger
+restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
+unmark *
+mark *
+done
+yes
+wait
+list volumes
+list jobs
+messages
+@output
+quit
+END_OF_DATA
+
+run_bacula
+check_for_zombie_jobs storage=File
+stop_bacula
+
+check_two_logs
+check_restore_diff
+end_test
scripts/cleanup
scripts/copy-2disk-drive-confs
-scripts/prepare-two-disks
+scripts/prepare-disk-changer
CLIENT=2drive2disk