3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then create some
9 # new files, do a differential and restore those two files.
11 TestName="differential-test"
16 scripts/copy-test-confs
17 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
18 mkdir -p ${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
25 change_jobname CompressedTest $JobName
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @$out ${cwd}/tmp/log1.out
32 setdebug level=100 storage=File
33 label storage=File volume=TestVolume002
34 label storage=File volume=TestVolume001
43 scripts/check_for_zombie_jobs storage=File
44 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
45 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out ${cwd}/tmp/log1.out
51 @# Force differential on the second Volume
52 update volume=TestVolume002 VolStatus=Used
53 run level=differential job=$JobName yes
60 scripts/check_for_zombie_jobs storage=File
61 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
62 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
67 @$out ${cwd}/tmp/log1.out
68 run level=incremental job=$JobName yes
74 @$out ${cwd}/tmp/log2.out
75 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
83 scripts/check_for_zombie_jobs storage=File
88 # Delete .c files because we will only restore the txt files
90 rm -f ${cwd}/tmp/build/*.c
91 check_restore_tmp_build_diff