3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a backup of the Bacula build directory on two Volumes
9 # then migrate it to another device.
11 # This script uses the virtual disk autochanger
13 TestName="migration-volume-test"
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22 #cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
23 #sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
25 change_jobname NightlySave $JobName
29 # Note, we first backup into Pool Default,
30 # then Migrate into Pool Full.
31 # Pool Default uses Storage=File
32 # Pool Full uses Storage=DiskChanger
34 # Write out bconsole commands
35 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
38 @$out ${cwd}/tmp/log1.out
39 label storage=File volume=FileVolume001 Pool=Default
40 label storage=File volume=FileVolume002 Pool=Default
41 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
42 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
43 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
49 update volume=FileVolume001 VolStatus=Used
50 update volume=FileVolume002 VolStatus=Used
53 @# should migrate two jobs
54 @# setdebug level=11 dir
55 @echo "Run migrate-volume Job"
56 @#setdebug level=100 dir
57 run job=migrate-volume yes
65 status storage=DiskChanger
75 select * from JobMedia where JobId=1;
77 @# Now run a second Migration job, which should do nothing
78 run job=migrate-volume yes
81 @# ensure we don't pickup old backup by purging volume
82 @# purge volume=FileVolume001
83 @# purge volume=FileVolume002
84 @echo "Now do a restore"
89 @$out ${cwd}/tmp/log2.out
90 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
101 check_for_zombie_jobs storage=File