3 # Run a big test with backup of millions of files then run 100 incremental
4 # modifying 10% each time
11 ${rscripts}/copy-test-confs
12 echo "${cwd}/files" >${tmp}/file-list
13 rm -rf ${tmp}/bacula-restores
16 change_jobname CompressedTest $JobName
17 if [ "$1" = "accurate" ]; then
18 sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1
19 mv $tmp/1 $conf/bacula-dir.conf
24 # Create X million of files
25 echo "Creating 1.5M files"
27 my $dest="'$cwd/files'";
30 $base = chr(1450000 % 26 + 65);
31 if (-f "$dest/$base/aaa1450000aaa$base") {
35 for(my $i=0; $i < 26; $i++) {
37 mkdir("$dest/$base") or die "$dest/$base $!";
39 for(my $i=0; $i<=1500000; $i++) {
40 $base = chr($i % 26 + 65);
41 open(FP, ">$dest/$base/aaa${i}aaa$base") or die "$dest/$base $!";
45 mkdir "$dest/$base/$base$i$base" if (!($i % 100));
46 print "." if (!($i % 10000));
51 cat <<END_OF_DATA >${tmp}/bconcmds
55 label storage=File volume=TestVolume001
63 check_for_zombie_jobs storage=File
65 cat <<END_OF_DATA >${tmp}/bconcmds
69 run job=$JobName level=Full yes
75 # insert 15 million files into File table
81 cat <<END_OF_DATA >${tmp}/bconcmds
85 run job=$JobName level=Incremental yes
96 my $dest="'$cwd/files'";
98 my $base = chr($start + 65);
100 opendir(DIR, "$dest/$base") || die "$!";
102 open(FP, ">$dest/$base/$_") or die "$_ $!";
103 print FP "update $_\n";
105 } grep { ! /^\./ } readdir(DIR);
112 cat <<END_OF_DATA >${tmp}/bconcmds
118 @$out ${tmp}/log2.out
120 restore where=${tmp}/bacula-restores storage=File select all done yes
130 check_for_zombie_jobs storage=File
136 find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
138 rm -rf ${tmp}/bacula-restores