3 # Run a simple backup of the Bacula build directory then do a virtual
4 # backup to another device.
6 # This script uses the virtual disk autochanger
8 TestName="virtual-backup-test"
14 scripts/copy-migration-confs
15 scripts/prepare-two-disks
16 echo "${cwd}/build" >${cwd}/tmp/file-list
18 change_jobname NightlySave $JobName
22 # Note, we first backup into Pool Default,
23 # then Migrate into Pool Full.
24 # Pool Default uses Storage=File
25 # Pool Full uses Storage=DiskChanger
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @$out ${cwd}/tmp/log1.out
32 @#setdebug level=100 storage=File
33 label storage=File volume=FileVolume001 Pool=Default
34 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
35 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
37 run job=$JobName level=Full yes
41 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
42 run job=$JobName level=Incremental yes
46 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
47 run job=$JobName level=Differential yes
51 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
52 run job=$JobName level=Incremental yes
60 @$out ${cwd}/tmp/log2.out
61 restore where=${cwd}/tmp/bacula-restores select
67 @#setdebug level=100 dir
68 @# should Consolidate Full, Differential and Incremental
69 @#setdebug level=51 storage=DiskChanger
70 run job=$JobName level=VirtualFull yes
78 @$out ${cwd}/tmp/log2.out
79 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
85 update Volume=ChangerVolume002
91 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
92 run job=$JobName level=Incremental yes
97 @# Now do another Consolidation
98 setdebug level=150 storage=DiskChanger
99 run job=$JobName level=VirtualFull yes
107 @$out ${cwd}/tmp/log2.out
108 setdebug level=0 storage=DiskChanger
109 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
123 check_for_zombie_jobs storage=File