3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Author: Eric Bollengier, 2009
11 # Run a simple backup of the Bacula build directory using the compressed option
12 # then backup a second time and finally restore it
14 TestName="exclude-dir-test"
20 scripts/copy-test-confs
21 cat >> $conf/bacula-dir.conf <<EOF
25 Exclude Dir Containing = ".nobkp"
33 Exclude Dir Containing = "bacula-dir.conf"
40 File = "$cwd/build/po"
44 sed 's/FileSet="CompressedSet"/FileSet=ExcludeDir/' $conf/bacula-dir.conf >$tmp/1
45 cp -f $tmp/1 $conf/bacula-dir.conf
46 change_jobname CompressedTest $JobName
49 mkdir -p ${cwd}/build/src/xxtestdir
50 touch ${cwd}/build/src/xxtestdir/.nobkp
51 cp ${cwd}/build/src/dird/*.c ${cwd}/build/src/xxtestdir
53 cat >tmp/bconcmds <<END_OF_DATA
57 estimate job=$JobName listing
60 label storage=File volume=TestVolume001
65 restore where=${cwd}/tmp/bacula-restores select all storage=File done
73 check_for_zombie_jobs storage=File
78 # should be ok if we remove the xxtestdir
79 rm -rf ${cwd}/build/src/xxtestdir
82 grep '/xxtestdir' $tmp/log3.out > /dev/null
84 print_debug "ERROR: Should not see xxtestdir in estimate output"
88 # build/po is included 2 times with a different exclude file
89 # we shouldn't see scripts and bin
90 nb=`egrep -c 'build/po/fr.po$' $tmp/log3.out`
92 print_debug "ERROR: Should see fr.po two times"
96 grep $rscripts $tmp/log3.out > /dev/null
98 print_debug "ERROR: Should not $rscripts in estimate output"
102 grep $conf $tmp/log3.out > /dev/null
104 print_debug "ERROR: Should not $conf in estimate output"