3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
6 # This script uses the virtual disk autochanger and two drives
8 TestName="2drive-2disk"
13 scripts/copy-2disk-drive-confs
14 scripts/prepare-two-disks
18 change_jobname localhost-fd $JobName
21 echo "${cwd}/build" >${cwd}/tmp/file-list
23 # Turn off Prefer Mounted Volumes so we use 2 drives
24 outf="${cwd}/tmp/sed_tmp"
25 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
26 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
27 # Comment the next line out to write everything to one drive
28 # otherwise, it writes the two jobs to different drives
29 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
31 # Write out bconsole commands
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
35 @$out ${cwd}/tmp/log1.out
37 setdebug level=3 storage=DDS-4
38 setdebug level=3 client=$CLIENT
39 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=1
40 # label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
42 setdebug level=120 storage=DDS-4
43 run job=NightlySave level=Full yes
45 run job=NightlySave level=Full yes
47 run job=NightlySave level=Full yes
49 run job=NightlySave level=Full yes
51 run job=NightlySave level=Full yes
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
67 @$out ${cwd}/tmp/log1.out
68 @# Force Incremental on the second Volume
69 # update volume=TestVolume001 VolStatus=Used
71 @#setdebug level=120 storage=DDS-4
72 run level=Incremental job=NightlySave yes
80 @$out ${cwd}/tmp/log2.out
81 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
90 check_for_zombie_jobs storage=DDS-4