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
16 change_jobname localhost-fd $JobName
19 echo "${cwd}/build" >${cwd}/tmp/file-list
21 # Turn off Prefer Mounted Volumes so we use 2 drives
22 outf="${cwd}/tmp/sed_tmp"
23 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
24 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
25 # Comment the next line out to write everything to one drive
26 # otherwise, it writes the two jobs to different drives
27 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out ${cwd}/tmp/log1.out
35 setdebug level=3 storage=DDS-4
36 setdebug level=3 client
37 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=1
38 # label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
40 setdebug level=120 storage=DDS-4
41 run job=NightlySave level=Full yes
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
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @$out ${cwd}/tmp/log1.out
66 @# Force Incremental on the second Volume
67 # update volume=TestVolume001 VolStatus=Used
69 @#setdebug level=120 storage=DDS-4
70 run level=Incremental job=NightlySave yes
78 @$out ${cwd}/tmp/log2.out
79 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
88 check_for_zombie_jobs storage=DDS-4