3 # This script will test prune algo
11 scripts/copy-test-confs
15 echo $PWD/build/po > tmp/file-list
17 # We want to have pruning only when doing prune command
18 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "AutoPrune", "No", "Client")'
19 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "Job Retention", "1s", "Client")'
21 # Add a new job with a different fileset
22 $bperl -e 'print get_resource("$conf/bacula-dir.conf", "Job", "NightlySave")' | \
23 sed s/NightlySave/DailySave/ | sed 's/Full Set/CompressedSet/' > $tmp/1
25 cat $tmp/1 >> $conf/bacula-dir.conf
27 cat <<EOF > ${cwd}/tmp/bconcmds
31 label storage=File volume=TestVolume001
32 run job=$JobName level=full yes
35 @exec "touch $cwd/build/po/fr.po"
36 run job=$JobName level=incremental yes
39 @exec "touch $cwd/build/po/de.po"
40 run job=$JobName level=incremental yes
43 @# run a second set of backup
44 run job=DailySave level=full yes
47 @exec "touch $cwd/build/po/fr.po"
48 run job=DailySave level=incremental yes
51 @exec "touch $cwd/build/po/de.po"
52 run job=DailySave level=incremental yes
57 @# should prune nothing
66 # should find nothing to prune
67 $bperl -e "check_prune_list('$tmp/log10.out')"
69 # rename the job to see if it's pruned
70 sed s/DailySave/DisabledBackup/ $conf/bacula-dir.conf > $tmp/1
71 mv $tmp/1 $conf/bacula-dir.conf
73 cat <<EOF > ${cwd}/tmp/bconcmds
77 @# should prune jobs using DailySave
85 $bperl -e "check_prune_list('$tmp/log11.out', 4, 5, 6)"
86 estat=$(($estat + $?))
88 # rename Full Set fileset to see if it will be pruned the next time
89 $bperl -e 'add_attribute("$conf/bacula-dir.conf", "FileSet", "CompressedSet", "Job", "NightlySave")'
90 sed "s/Full Set/DisFullSet/g" $conf/bacula-dir.conf > $tmp/1
91 mv $tmp/1 $conf/bacula-dir.conf
93 cat <<EOF > ${cwd}/tmp/bconcmds
97 @# should prune jobs using Full Set
105 $bperl -e "check_prune_list('$tmp/log12.out', 1, 2, 3)"
106 estat=$(($estat + $?))
108 check_for_zombie_jobs storage=File