3 # Run a simple backup of the Bacula build directory then migrate it
6 # This script uses the virtual disk autochanger
8 TestName="migration-time-test"
9 JobName=MigrationJobSave
14 scripts/copy-migration-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 uses Storage=File
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 label storage=File volume=FileVolume001 Pool=Default
33 label storage=File volume=FileVolume002 Pool=Special
34 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
35 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
38 run job=$JobName pool=Special level=Full yes
39 run job=$JobName level=Full yes
40 run job=$JobName level=Full yes
42 update volume=FileVolume001 VolStatus=Used
43 update volume=FileVolume002 VolStatus=Used
48 @#setdebug level=20 dir
49 @# should migrate only jobid=2 and 3
50 run job=migrate-time yes
59 @$out ${cwd}/tmp/log2.out
60 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
72 check_for_zombie_jobs storage=File
76 get_mig_info $i ${cwd}/tmp/log1.out
78 if [ "$i" -eq 1 -a -n "$RET" ]; then
80 print_debug "The first job should not have been copied"
82 elif [ "$i" -ne 1 -a -z "$RET" ]; then
84 print_debug "Other job should have been copied"