3 # Run a simple backup of the Bacula build directory then copy it
6 # This script uses the virtual disk autochanger
8 TestName="copy-job-test"
14 scripts/copy-migration-confs
15 scripts/prepare-disk-changer
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
18 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
21 change_jobname NightlySave $JobName
25 # Note, we first backup into Pool Default,
26 # then Copy into Pool Full.
27 # Pool Default uses Storage=File
28 # Pool Full uses Storage=DiskChanger
30 # Write out bconsole commands
31 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 @$out ${cwd}/tmp/log1.out
35 @# setdebug level=100 storage=File
36 label storage=File volume=FileVolume001 Pool=Default
37 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
38 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
39 @# run two jobs (both will be copied)
45 @#setdebug level=100 dir
46 @# should copy two jobs
47 @#setdebug level=51 storage=DiskChanger
51 @#purge volume=FileVolume001
56 @$out ${cwd}/tmp/log3.out
58 @# Now do another backup, but level Incremental
60 run job=$JobName level=Incremental yes
64 @# This final job that runs should be Incremental and
65 @# not upgraded to full.
70 @$out ${cwd}/tmp/log2.out
72 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
84 check_for_zombie_jobs storage=File
90 grep 'Backup Level:' tmp/log3.out | grep Incremental > /dev/null
93 print_debug "The incremental job must use copied jobs"