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-virtual-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 forced to use Storage=DiskChanger
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=150 storage=DiskChanger
33 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Default drive=0
34 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Default drive=0
35 label storage=DiskChanger volume=ChangerVolume003 slot=3 Pool=Default drive=0
36 label storage=DiskChanger volume=ChangerVolume004 slot=4 Pool=Full drive=0
37 label storage=DiskChanger volume=ChangerVolume005 slot=5 Pool=Full drive=0
38 setdebug level=0 storage=DiskChanger
40 @exec "sh -c 'date > ${cwd}/build/date'"
41 run job=$JobName level=Full storage=DiskChanger yes
46 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
47 run job=$JobName level=Incremental storage=DiskChanger yes
52 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
53 run job=$JobName level=Differential storage=DiskChanger yes
58 @exec "sh -c 'date > ${cwd}/build/date'"
59 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
60 run job=$JobName level=Incremental storage=DiskChanger yes
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores select
77 @#setdebug level=100 dir
79 @# Now do a Virtual backup
81 setdebug level=151 storage=DiskChanger
82 run job=$JobName level=VirtualFull storage=DiskChanger yes
88 @# now do a restore of the Virtual backup
90 @$out ${cwd}/tmp/log2.out
91 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
97 @# Move Volume to Default pool
98 update Volume=ChangerVolume002
104 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
106 @# Do an incremental on top of the Virtual Full
108 run job=$JobName level=Incremental storage=DiskChanger yes
114 @# Now do another Consolidation
116 setdebug level=150 storage=DiskChanger
117 run job=$JobName level=VirtualFull storage=DiskChanger yes
123 @# now do a restore should restore from new Virtual backup
125 @$out ${cwd}/tmp/log2.out
126 setdebug level=0 storage=DiskChanger
127 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
140 check_for_zombie_jobs storage=DiskChanger