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 bin/bacula stop 2>&1 >/dev/null
10 bin/drop_sqlite_tables
11 bin/make_sqlite_tables
13 scripts/copy-2tape-confs
15 echo "${cwd}/tmp/build" >/tmp/file-list
16 if test ! -d ${cwd}/tmp/build ; then
17 mkdir ${cwd}/tmp/build
19 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
21 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
22 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
27 echo " === Starting incremental-2tape test ==="
28 echo " === Starting incremental-2tape test ===" >>working/log
31 bin/bacula start 2>&1 >/dev/null
32 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
36 label storage=DDS-4 volume=TestVolume001 slot=1
37 label storage=DDS-4 volume=TestVolume002 slot=2
38 run job=NightlySave yes
43 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
44 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
45 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
49 @# Force Incremental on the second Volume
50 update volume=TestVolume001 VolStatus=Used
51 run level=Incremental job=NightlySave yes
58 restore where=${cwd}/tmp/bacula-restores
60 <${cwd}/tmp/restore-list
68 bin/bacula stop 2>&1 >/dev/null
69 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
71 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
74 # Delete .c files because we will only restored the txt files
77 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
78 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
81 echo " !!!!! incremental-2tape test Bacula source failed!!! !!!!! "
82 echo " !!!!! incremental-2tape test failed!!! !!!!! " >>test.out
85 echo " ===== incremental-2tape test Bacula source OK ===== "
86 echo " ===== incremental-2tape test OK ===== " >>test.out