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 echo "${cwd}/build" >${cwd}/tmp/file-list
16 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
17 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
20 change_jobname NightlySave $JobName
24 # Note, we first backup into Pool Default,
25 # then Copy into Pool Full.
26 # Pool Default uses Storage=File
27 # Pool Full uses Storage=DiskChanger
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
34 @# setdebug level=100 storage=File
35 label storage=File volume=FileVolume001 Pool=Default
36 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
37 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
38 @# run two jobs (both will be copied)
45 @#setdebug level=100 dir
46 @# should copy two jobs
47 @#setdebug level=51 storage=DiskChanger
48 @#setdebug level=100 storage=File tags=dedup,asx,network options=h
52 @#purge volume=FileVolume001
57 @$out ${cwd}/tmp/log3.out
59 @# Now do another backup, but level Incremental
61 run job=$JobName level=Incremental yes
65 @# This final job that runs should be Incremental and
66 @# not upgraded to full.
71 @$out ${cwd}/tmp/log2.out
73 @#setdebug level=15 director
74 @#setdebug level=150 storage=DiskChanger
75 @# Note, here we are restoring from the original backup,
76 @# so if you specify storage=DiskChanger the restore will fail
77 restore where=${cwd}/tmp/bacula-restores select
89 check_for_zombie_jobs storage=File
95 grep 'Backup Level:' tmp/log3.out | grep Incremental > /dev/null
98 print_debug "The incremental job must use copied jobs"