3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then migrate it
11 # Test copy a job that spans two Volumes
13 # This script uses the virtual disk autochanger
15 TestName="copy-jobspan-test"
16 JobName=CopyJobSpanSave
21 scripts/copy-migration-confs
22 scripts/prepare-disk-changer
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
25 sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
26 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
27 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
29 change_jobname NightlySave $JobName
33 # Note, we first backup into Pool Default,
34 # then Copy into Pool Full.
35 # Pool Default uses Storage=File
36 # Pool Full uses Storage=DiskChanger
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log1.out
43 @#setdebug level=10 dir
44 @#setdebug level=100 storage=File
45 label storage=File volume=FileVolume001 Pool=Default
46 label storage=File volume=FileVolume002 Pool=Default
47 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
48 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
49 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
53 @#run job=$JobName yes
56 @#setdebug level=200 dir
57 @# should migrate both Volumes
60 purge volume=FileVolume001
61 purge volume=FileVolume002
69 @# Check if JobMedia OK (run under Aligned)
71 select jobid, mediaid, firstindex,lastindex,volindex from JobMedia order by jobid,volindex;
72 select * from JobMedia order by jobid,volindex;
74 @$out ${cwd}/tmp/log2.out
75 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
86 check_for_zombie_jobs storage=File