3 # Run a simple backup of the Bacula build directory then do a
4 # Virtual Full backup to another device.
6 # This script uses the disk autochanger
8 TestName="virtual-backup-test"
14 scripts/copy-migration-confs
15 scripts/prepare-disk-changer
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 @exec "sh -c 'date > ${cwd}/build/date'"
38 run job=$JobName level=Full yes
42 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
43 run job=$JobName level=Incremental yes
47 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
48 run job=$JobName level=Differential yes
52 @exec "sh -c 'date > ${cwd}/build/date'"
53 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
54 run job=$JobName level=Incremental yes
60 @# now do a normal restore of normal backups
63 restore where=${cwd}/tmp/bacula-restores select
69 @# should Consolidate Full, Differential and Incremental
70 setdebug level=150 storage=DiskChanger
71 setdebug level=100 dir
72 run job=$JobName level=VirtualFull yes
78 @# now do a restore of the consolidated Full
80 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
93 check_for_zombie_jobs storage=File
97 # We only used one log so copy it to the second log
98 # so that any restore errors will be picked up
100 cp -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out