3 # Run a big test with backup of millions of files then run 100 incremental
4 # modifying 10% each time
6 # Can use following env variables
19 ${rscripts}/copy-test-confs
20 sed 's/Max Run Time/#Max Run Time/' $conf/bacula-dir.conf > $tmp/1
21 sed 's/SpoolData/#SpoolData/' $tmp/1 > $conf/bacula-dir.conf
23 echo "${cwd}/files" >${tmp}/file-list
24 rm -rf ${tmp}/bacula-restores
27 change_jobname CompressedTest $JobName
28 if [ a$ACCURATE != a ]; then
29 sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1
30 mv $tmp/1 $conf/bacula-dir.conf
33 if [ a$BASEJOB != a ]; then
34 sed 's/Name = "speed"/Name = "speed"; accurate=yes;basejob=speed/' $conf/bacula-dir.conf > $tmp/1
35 mv $tmp/1 $conf/bacula-dir.conf
39 NB_CONCURENT=${NB_CONCURENT:-1}
40 NB_FULL=${NB_FULL:-20}
41 NB_INCR=${NB_INCR:-25}
42 NB_FILES=${NB_FILES:-750000}
46 # Create X million of files
47 echo "Creating $NB_FILES files"
48 perl -Mscripts::functions -e "create_many_files('$cwd/files', $NB_FILES);"
50 cat <<END_OF_DATA >${tmp}/bconcmds
54 label storage=File volume=TestVolume001
55 run job=$JobName $basejob yes
62 check_for_zombie_jobs storage=File
64 cat <<END_OF_DATA >${tmp}/bconcmds
70 for j in $(seq 1 $NB_CONCURENT)
72 cat <<EOF >>${tmp}/bconcmds
74 run job=$JobName level=Full yes
78 cat <<EOF >>${tmp}/bconcmds
84 # insert X million files into File table
85 for i in $(seq 0 $NB_FULL)
90 # Now, run many incremental
91 sed 's/Full/Incremental/' ${tmp}/bconcmds > $tmp/1
92 mv $tmp/1 ${tmp}/bconcmds
94 for i in $(seq 0 $NB_INCR)
96 perl -Mscripts::functions -e "update_some_files('$cwd/files/'.chr($i+65));"
100 cat <<END_OF_DATA >${tmp}/bconcmds
106 @$out ${tmp}/log2.out
108 restore where=${tmp}/bacula-restores storage=File select all done yes
118 check_for_zombie_jobs storage=File
124 find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
125 rm -rf ${tmp}/bacula-restores
127 # check the time needed to compute restore list
128 if [ x$db_password != x ]; then
131 (time $src/src/tools/bbatch -r 1 -n $db_name -u $db_user $p -w $tmp) >> $working/log 2>&1
133 cp $working/log files/log${WHICHDB}-$(date +%F_%H-%M).log
134 cp $tmp/log2.out files/log2${WHICHDB}-$(date +%F_%H-%M).log