3 # Run a simple backup of the Bacula build directory then create some
4 # new files, do a Decremental 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
18 ./drop_bacula_tables >/dev/null 2>&1
19 ./make_bacula_tables >/dev/null 2>&1
20 ./grant_bacula_privileges 2>&1 >/dev/null
25 echo " === Starting decremental-test ==="
26 echo " === Starting decremental-test ===" >>working/log
29 bin/bacula start 2>&1 >/dev/null
30 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
34 label storage=File volume=TestVolume001
35 label storage=File volume=TestVolume002
36 run job=CompressedTest yes
41 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
42 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
43 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
47 @# Force decremental on the second Volume
48 update volume=TestVolume001 VolStatus=Used
49 run level=decremental job=CompressedTest yes
54 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
55 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
59 run level=incremental job=CompressedTest yes
66 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
73 bin/bacula stop 2>&1 >/dev/null
74 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
76 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
79 # Delete .c files because we will only restored the txt files
82 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
83 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
86 echo " !!!!! decremental-test Bacula source failed!!! !!!!! "
87 echo " !!!!! decremental-test failed!!! !!!!! " >>test.out
90 echo " ===== decremental-test Bacula source OK ===== "
91 echo " ===== decremental-test OK ===== " >>test.out