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 autochanger and two tapes
9 if test x${TAPE_DRIVE1} = x/dev/null ; then
10 echo "Skipping 2drive-incremenatal-2tape test. No second drive."
13 TestName="2drive-incremental-2tape"
20 scripts/copy-2drive-confs
21 scripts/cleanup-2drive
23 change_jobname localhost-fd $JobName
25 echo "${cwd}/tmp/build" >/tmp/file-list
26 if test ! -d ${cwd}/tmp/build ; then
27 mkdir ${cwd}/tmp/build
29 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
31 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
32 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
35 # Turn off Prefer Mounted Volumes so we use 2 drives
37 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
38 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
39 # Comment the next line out to write everything to one drive
40 # otherwise, it writes the two jobs to different drives
41 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
45 # Write out bconsole commands
46 cat <<END_OF_DATA >tmp/bconcmds
50 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
51 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
52 @#setdebug level=100 storage=DDS-4
53 run job=NightlySave yes
54 run job=NightlySave yes
55 run job=NightlySave yes
56 run job=NightlySave yes
57 run job=NightlySave yes
70 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
71 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
73 cat <<END_OF_DATA >tmp/bconcmds
77 @# Force Incremental on the second Volume
78 update volume=TestVolume001 VolStatus=Used
80 @#setdebug level=400 storage=DDS-4
81 run level=Incremental job=NightlySave yes
90 restore where=${cwd}/tmp/bacula-restores
92 <${cwd}/tmp/restore-list
102 check_for_zombie_jobs storage=DDS-4
107 # Delete .c files because we will only restored the txt files
110 check_restore_tmp_build_diff