3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then do a
9 # Virtual Full backup to another device.
11 # This script uses the disk autochanger
13 TestName="virtual-backup-test"
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
23 change_jobname NightlySave $JobName
27 # Note, we first backup into Pool Default,
28 # then Migrate into Pool Full.
29 # Pool Default uses Storage=File
30 # Pool Full uses Storage=DiskChanger
32 # Write out bconsole commands
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
36 @$out ${cwd}/tmp/log1.out
37 @#setdebug level=100 storage=File
38 label storage=File volume=FileVolume001 Pool=Default
39 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
40 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
42 @exec "sh -c 'date > ${cwd}/build/date'"
43 run job=$JobName level=Full yes
47 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
48 run job=$JobName level=Incremental yes
52 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
53 run job=$JobName level=Differential yes
57 @exec "sh -c 'date > ${cwd}/build/date'"
58 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
59 run job=$JobName level=Incremental yes
65 @# now do a normal restore of normal backups
68 restore where=${cwd}/tmp/bacula-restores select
74 @# should Consolidate Full, Differential and Incremental
75 @#setdebug level=150 storage=DiskChanger
76 @#setdebug level=100 dir
77 run job=$JobName level=VirtualFull yes
83 @# now do a restore of the consolidated Full
85 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
98 check_for_zombie_jobs storage=File
102 # We only used one log so copy it to the second log
103 # so that any restore errors will be picked up
105 cp -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out