3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a big test with backup of millions of files then run 100 incremental
9 # modifying 10% each time
11 # Can use following env variables
24 ${rscripts}/copy-test-confs
25 sed 's/Max Run Time/#Max Run Time/' $conf/bacula-dir.conf > $tmp/1
26 sed 's/SpoolData/#SpoolData/' $tmp/1 > $conf/bacula-dir.conf
28 echo "${cwd}/files" >${tmp}/file-list
29 rm -rf ${tmp}/bacula-restores
32 change_jobname CompressedTest $JobName
33 if [ a$ACCURATE != a ]; then
34 sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1
35 mv $tmp/1 $conf/bacula-dir.conf
38 if [ a$BASEJOB != a ]; then
39 sed 's/Name = "speed"/Name = "speed"; accurate=yes;basejob=speed/' $conf/bacula-dir.conf > $tmp/1
40 mv $tmp/1 $conf/bacula-dir.conf
44 NB_CONCURENT=${NB_CONCURENT:-1}
45 NB_FULL=${NB_FULL:-20}
46 NB_INCR=${NB_INCR:-25}
47 NB_FILES=${NB_FILES:-750000}
51 # Create X million of files
52 echo "Creating $NB_FILES files"
53 perl -Mscripts::functions -e "create_many_files('$cwd/files', $NB_FILES);"
55 cat <<END_OF_DATA >${tmp}/bconcmds
59 label storage=File volume=TestVolume001
60 run job=$JobName $basejob yes
67 check_for_zombie_jobs storage=File
69 cat <<END_OF_DATA >${tmp}/bconcmds
75 for j in $(seq 1 $NB_CONCURENT)
77 cat <<EOF >>${tmp}/bconcmds
79 run job=$JobName level=Full yes
83 cat <<EOF >>${tmp}/bconcmds
89 # insert X million files into File table
90 for i in $(seq 0 $NB_FULL)
95 # Now, run many incremental
96 sed 's/Full/Incremental/' ${tmp}/bconcmds > $tmp/1
97 mv $tmp/1 ${tmp}/bconcmds
99 for i in $(seq 0 $NB_INCR)
101 perl -Mscripts::functions -e "update_some_files('$cwd/files/'.chr($i+65));"
105 cat <<END_OF_DATA >${tmp}/bconcmds
111 @$out ${tmp}/log2.out
113 restore where=${tmp}/bacula-restores storage=File select all done yes
123 check_for_zombie_jobs storage=File
129 find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
130 rm -rf ${tmp}/bacula-restores
132 # check the time needed to compute restore list
133 if [ x$db_password != x ]; then
136 (time $src/src/tools/bbatch -r 1 -n $db_name -u $db_user $p -w $tmp) >> $working/log 2>&1
138 cp $working/log files/log${WHICHDB}-$(date +%F_%H-%M).log
139 cp $tmp/log2.out files/log2${WHICHDB}-$(date +%F_%H-%M).log