3 # Run a simple backup of the Bacula build directory then copy it
6 # This script uses the virtual disk autochanger
8 TestName="copy-time-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
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 label storage=File volume=FileVolume001 Pool=Default
35 label storage=File volume=FileVolume002 Pool=Special
36 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
37 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
40 run job=$JobName Pool=Special level=Full yes
41 run job=$JobName level=Full yes
42 run job=$JobName level=Full yes
45 update volume=FileVolume001 VolStatus=Used
46 update volume=FileVolume002 VolStatus=Used
50 @#setdebug level=20 dir
51 @# should copy only jobid=2 and 3
53 run job=copy-time pool=Special yes
59 purge volume=FileVolume001
60 purge volume=FileVolume002
64 @$out ${cwd}/tmp/log2.out
65 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
76 check_for_zombie_jobs storage=File
80 get_mig_info $i ${cwd}/tmp/log1.out
82 if [ "$i" -eq 1 -a -n "$RET" ]; then
84 print_debug "The first job should not have been copied"
86 elif [ "$i" -ne 1 -a -z "$RET" ]; then
88 print_debug "Other job should have been copied"