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 create some
9 # new files, do an Incremental and restore those two files.
11 # This script uses the virtual disk autochanger and two drives
13 TestName="2drive-2disk"
18 scripts/copy-2disk-drive-confs
19 scripts/prepare-disk-changer
23 change_jobname localhost-fd $JobName
26 echo "${cwd}/build" >${cwd}/tmp/file-list
28 # Turn off Prefer Mounted Volumes so we use 2 drives
29 outf="${cwd}/tmp/sed_tmp"
30 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
31 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
32 # Comment the next line out to write everything to one drive
33 # otherwise, it writes the two jobs to different drives
34 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
36 # Write out bconsole commands
37 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @$out ${cwd}/tmp/log1.out
42 setdebug level=3 storage=tape
43 setdebug level=3 client=$CLIENT
44 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=1
45 # label storage=tape volume=TestVolume002 slot=2 Pool=Default drive=1
47 setdebug level=120 storage=tape
48 run job=NightlySave level=Full yes
50 run job=NightlySave level=Full yes
52 run job=NightlySave level=Full yes
54 run job=NightlySave level=Full yes
56 run job=NightlySave level=Full yes
69 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
72 @$out ${cwd}/tmp/log1.out
73 @# Force Incremental on the second Volume
74 # update volume=TestVolume001 VolStatus=Used
76 @#setdebug level=120 storage=tape
77 run level=Incremental job=NightlySave yes
85 @$out ${cwd}/tmp/log2.out
86 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
95 check_for_zombie_jobs storage=tape