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 drives
8 TestName="2drive-incremental-2t2da-tape"
17 scripts/copy-2drive-confs
18 scripts/cleanup-2drive
20 change_jobname localhost-fd $JobName
22 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
23 if test ! -d ${cwd}/tmp/build ; then
24 mkdir ${cwd}/tmp/build
26 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
28 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
29 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
32 # Turn off Prefer Mounted Volumes so we use 2 drives
33 outf="${cwd}/tmp/sed_tmp"
34 echo "s%# Prefer Mounted Volumes% Prefer Mounted Volumes%g" >${outf}
35 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
36 # Comment the next line out to write everything to one drive
37 # otherwise, it writes the two jobs to different drives
38 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
42 # Write out bconsole commands
43 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
46 @$out ${cwd}/tmp/log1.out
47 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
48 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
49 @#setdebug level=100 storage=DDS-4
50 run job=NightlySave yes
51 run job=NightlySave yes
52 run job=NightlySave yes
53 run job=NightlySave yes
54 run job=NightlySave yes
67 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
68 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
70 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
73 @$out ${cwd}/tmp/log1.out
74 @# Force Incremental on the second Volume
75 update volume=TestVolume001 VolStatus=Used
77 @#setdebug level=400 storage=DDS-4
78 run level=Incremental job=NightlySave yes
86 @$out ${cwd}/tmp/log2.out
87 restore where=${cwd}/tmp/bacula-restores
89 <${cwd}/tmp/restore-list
99 check_for_zombie_jobs storage=DDS-4
104 # Delete .c files because we will only restored the txt files
106 rm -f ${cwd}/tmp/build/*.c
107 check_restore_tmp_build_diff