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 copy it
11 # This script uses the virtual disk autochanger
13 TestName="copy-time-test"
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
23 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
25 change_jobname NightlySave $JobName
29 # Note, we first backup into Pool Default,
30 # then Copy 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=Special
41 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
42 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
45 run job=$JobName Pool=Special level=Full yes
46 run job=$JobName level=Full yes
47 run job=$JobName level=Full yes
50 update volume=FileVolume001 VolStatus=Used
51 update volume=FileVolume002 VolStatus=Used
55 @#setdebug level=20 dir
56 @# should copy only jobid=2 and 3
58 run job=copy-time pool=Special yes
64 purge volume=FileVolume001
65 purge volume=FileVolume002
69 @$out ${cwd}/tmp/log2.out
70 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
81 check_for_zombie_jobs storage=File
85 get_mig_info $i ${cwd}/tmp/log1.out
87 if [ "$i" -eq 1 -a -n "$RET" ]; then
89 print_debug "The first job should not have been copied"
91 elif [ "$i" -ne 1 -a -z "$RET" ]; then
93 print_debug "Other job should have been copied"