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
8 if test x${TAPE_DRIVE1} = x/dev/null ; then
9 echo "Skipping 2drive-incremenatal-2tape test. No second drive."
12 TestName="2drive-incremental-2tape"
16 scripts/copy-2drive-confs
17 scripts/cleanup-2drive
19 change_jobname localhost-fd $JobName
21 echo "${cwd}/tmp/build" >/tmp/file-list
22 if test ! -d ${cwd}/tmp/build ; then
23 mkdir ${cwd}/tmp/build
25 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
27 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
28 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
31 # Turn off Prefer Mounted Volumes so we use 2 drives
33 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
34 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
35 # Comment the next line out to write everything to one drive
36 # otherwise, it writes the two jobs to different drives
37 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
41 # Write out bconsole commands
42 cat <<END_OF_DATA >tmp/bconcmds
46 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
47 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
48 @#setdebug level=100 storage=DDS-4
49 run job=NightlySave yes
50 run job=NightlySave yes
51 run job=NightlySave yes
52 run job=NightlySave yes
53 run job=NightlySave yes
66 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
67 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
69 cat <<END_OF_DATA >tmp/bconcmds
73 @# Force Incremental on the second Volume
74 update volume=TestVolume001 VolStatus=Used
76 @#setdebug level=400 storage=DDS-4
77 run level=Incremental job=NightlySave yes
86 restore where=${cwd}/tmp/bacula-restores
88 <${cwd}/tmp/restore-list
98 check_for_zombie_jobs storage=DDS-4
103 # Delete .c files because we will only restored the txt files
106 check_restore_tmp_build_diff