3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do an Incremental and restore those two files.
7 scripts/copy-test-confs
9 echo "${cwd}/tmp/build" >/tmp/file-list
10 mkdir ${cwd}/tmp/build
11 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
13 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
14 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
16 bin/bacula stop 2>&1 >/dev/null
17 bin/drop_sqlite_tables
18 bin/make_sqlite_tables
22 echo " === Starting incremental-test ==="
23 echo " === Starting incremental-test ===" >>working/log
26 bin/bacula start 2>&1 >/dev/null
27 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
31 label storage=File volume=TestVolume001
32 label storage=File volume=TestVolume002
33 run job=CompressedTest yes
38 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
39 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
40 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
44 @# Force Incremental on the second Volume
45 update volume=TestVolume001 VolStatus=Used
46 run level=Incremental job=CompressedTest yes
53 restore where=${cwd}/tmp/bacula-restores
55 <${cwd}/tmp/restore-list
63 bin/bacula stop 2>&1 >/dev/null
64 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
66 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
69 # Delete .c files because we will only restored the txt files
72 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
73 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
76 echo " !!!!! incremental-test Bacula source failed!!! !!!!! "
77 echo " !!!!! incremental-test failed!!! !!!!! " >>test.out
80 echo " ===== incremental-test Bacula source OK ===== "
81 echo " ===== incremental-test OK ===== " >>test.out