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"
16 scripts/copy-migration-confs
17 scripts/prepare-two-disks
18 echo "${cwd}/build" >/tmp/file-list
19 #cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
20 #sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
22 change_jobname NightlySave $JobName
26 # Note, we first backup into Pool Default,
27 # then Migrate into Pool Full.
28 # Pool Default uses Storage=File
29 # Pool Full uses Storage=DiskChanger
31 # Write out bconsole commands
32 cat <<END_OF_DATA >tmp/bconcmds
36 label storage=File volume=FileVolume001 Pool=Default
37 label storage=File volume=FileVolume002 Pool=Default
38 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
39 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
40 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
46 update volume=FileVolume001 VolStatus=Used
47 update volume=FileVolume002 VolStatus=Used
50 @# should migrate two jobs
51 @# setdebug level=11 dir
52 @echo "Run migrate-volume Job"
53 @#setdebug level=100 dir
54 run job=migrate-volume yes
62 status storage=DiskChanger
72 select * from JobMedia where JobId=1;
74 @# Now run a second Migration job, which should do nothing
75 run job=migrate-volume yes
78 @# ensure we don't pickup old backup by purging volume
79 @# purge volume=FileVolume001
80 @# purge volume=FileVolume002
81 @echo "Now do a restore"
87 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
99 check_for_zombie_jobs storage=File