3 # Run a backup of the Bacula build directory on two Volumes
4 # then copy it to another device.
6 # This script uses the virtual disk autochanger and migration scripts
8 TestName="copy-uncopied-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
21 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
22 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
23 rm -f ${cwd}/build/po/test.po >/dev/null
25 touch ${cwd}/tmp/log2.out
30 # Note, we first backup into Pool Default,
31 # then Copy into Pool Full.
32 # Pool Default uses Storage=File
33 # Pool Full uses Storage=DiskChanger
35 # Write out bconsole commands
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
39 @$out ${cwd}/tmp/log1.out
40 label storage=File volume=FileVolume001 Pool=Default
41 label storage=File volume=FileVolume002 Pool=Scratch
42 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Scratch drive=0
43 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Scratch drive=0
45 run job=$JobName level=Full yes
47 run job=$JobName level=Full yes
49 update volume=FileVolume001 VolStatus=Used
50 run job=$JobName level=Full yes
53 @$out ${cwd}/tmp/log11.out
54 @############################################################
55 @# should copy job 1,2,3
56 @# Expect: 3 copies (1,2,3)
57 @############################################################
58 @#setdebug level=100 dir
59 run job=copy-uncopied yes
66 @$out ${cwd}/tmp/log12.out
67 @############################################################
68 @# should not copy jobs
69 @# Expect: 3 copies (1,2,3)
70 @############################################################
71 run job=copy-uncopied yes
75 @$out ${cwd}/tmp/log13.out
76 @############################################################
77 @# should not have a copy of the copy
78 @# Expect: 2 copies (2,3)
79 @############################################################
81 run job=copy-uncopied yes
85 @$out ${cwd}/tmp/log14.out
86 @############################################################
87 @# should copy jobid=2
88 @# Expect: 2 copies (2,3)
89 @############################################################
91 run job=copy-uncopied yes
98 check_for_zombie_jobs storage=File
106 perl -Mscripts::functions -e 'check_multiple_copies(3)' tmp/log11.out
107 bstat=`expr $bstat + $?`
109 perl -Mscripts::functions -e 'check_multiple_copies(3)' tmp/log12.out
110 bstat=`expr $bstat + $?`
112 perl -Mscripts::functions -e 'check_multiple_copies(2)' tmp/log13.out
113 bstat=`expr $bstat + $?`
115 perl -Mscripts::functions -e 'check_multiple_copies(2)' tmp/log14.out
116 bstat=`expr $bstat + $?`