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 echo "${cwd}/files" >${tmp}/file-list
21 rm -rf ${tmp}/bacula-restores
24 change_jobname CompressedTest $JobName
25 if [ a$ACCURATE != a ]; then
26 sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1
27 mv $tmp/1 $conf/bacula-dir.conf
30 if [ a$BASEJOB != a ]; then
31 sed 's/Name = "speed"/Name = "speed"; accurate=yes;basejob=speed/' $conf/bacula-dir.conf > $tmp/1
32 mv $tmp/1 $conf/bacula-dir.conf
36 NB_CONCURENT=${NB_CONCURENT:-1}
37 NB_FULL=${NB_FULL:-20}
38 NB_INCR=${NB_INCR:-25}
39 NB_FILES=${NB_FILES:-750000}
43 # Create X million of files
44 echo "Creating $NB_FILES files"
45 perl -Mscripts::functions -e "create_many_files('$cwd/files', $NB_FILES);"
47 cat <<END_OF_DATA >${tmp}/bconcmds
51 label storage=File volume=TestVolume001
52 run job=$JobName $basejob yes
59 check_for_zombie_jobs storage=File
61 cat <<END_OF_DATA >${tmp}/bconcmds
67 for j in $(seq 1 $NB_CONCURENT)
69 cat <<EOF >>${tmp}/bconcmds
71 run job=$JobName level=Full yes
75 cat <<EOF >>${tmp}/bconcmds
81 # insert X million files into File table
82 for i in $(seq 0 $NB_FULL)
87 # Now, run many incremental
88 sed 's/Full/Incremental/' ${tmp}/bconcmds > $tmp/1
89 mv $tmp/1 ${tmp}/bconcmds
91 for i in $(seq 0 $NB_INCR)
93 perl -Mscripts::functions -e "update_some_files('$cwd/files/'.chr($i+65));"
97 cat <<END_OF_DATA >${tmp}/bconcmds
103 @$out ${tmp}/log2.out
105 restore where=${tmp}/bacula-restores storage=File select all done yes
115 check_for_zombie_jobs storage=File
121 find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
122 rm -rf ${tmp}/bacula-restores
124 # check the time needed to compute restore list
125 if [ x$db_password != x ]; then
128 (time $src/src/tools/bbatch -r 1 -n $db_name -u $db_user $p -w $tmp) >> $working/log 2>&1
130 cp $working/log files/log${WHICHDB}-$(date +%F_%H-%M).log
131 cp $tmp/log2.out files/log2${WHICHDB}-$(date +%F_%H-%M).log