3 # Run a backup of the Bacula build directory on two Volumes
4 # then migrate it to another device.
6 # This script uses the virtual disk autochanger
8 TestName="migration-volume-test"
14 scripts/copy-migration-confs
15 scripts/prepare-disk-changer
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17 #cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
18 #sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
20 change_jobname NightlySave $JobName
24 # Note, we first backup into Pool Default,
25 # then Migrate 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=Default
36 update Volume=FileVolume001 MaxVolBytes=3000000 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
44 update volume=FileVolume001 VolStatus=Used
45 update volume=FileVolume002 VolStatus=Used
48 @# should migrate two jobs
49 @# setdebug level=11 dir
50 @echo "Run migrate-volume Job"
51 @#setdebug level=100 dir
52 run job=migrate-volume yes
60 status storage=DiskChanger
70 select * from JobMedia where JobId=1;
72 @# Now run a second Migration job, which should do nothing
73 run job=migrate-volume yes
76 @# ensure we don't pickup old backup by purging volume
77 @# purge volume=FileVolume001
78 @# purge volume=FileVolume002
79 @echo "Now do a restore"
84 @$out ${cwd}/tmp/log2.out
85 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
96 check_for_zombie_jobs storage=File