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 echo $* | grep accurate >/dev/null; then
18 sed 's/Name = "speed"/Name = "speed"; accurate=yes/' $conf/bacula-dir.conf > $tmp/1
19 mv $tmp/1 $conf/bacula-dir.conf
22 if echo $* | grep basejob >/dev/null; then
23 sed 's/Name = "speed"/Name = "speed"; accurate=yes;basejob=speed/' $conf/bacula-dir.conf > $tmp/1
24 mv $tmp/1 $conf/bacula-dir.conf
30 # Create X million of files
31 echo "Creating 1.5M files"
33 my $dest="'$cwd/files'";
36 $base = chr(1450000 % 26 + 65);
37 if (-f "$dest/$base/aaa1450000aaa$base") {
41 for(my $i=0; $i < 26; $i++) {
43 mkdir("$dest/$base") or die "$dest/$base $!";
45 for(my $i=0; $i<=1500000; $i++) {
46 $base = chr($i % 26 + 65);
47 open(FP, ">$dest/$base/aaa${i}aaa$base") or die "$dest/$base $!";
51 mkdir "$dest/$base/$base$i$base" if (!($i % 100));
52 print "." if (!($i % 10000));
57 cat <<END_OF_DATA >${tmp}/bconcmds
61 label storage=File volume=TestVolume001
62 run job=$JobName $basejob yes
69 check_for_zombie_jobs storage=File
71 cat <<END_OF_DATA >${tmp}/bconcmds
75 run job=$JobName level=Full yes
81 # insert 15 million files into File table
87 cat <<END_OF_DATA >${tmp}/bconcmds
91 run job=$JobName level=Incremental yes
102 my $dest="'$cwd/files'";
104 my $base = chr($start + 65);
106 opendir(DIR, "$dest/$base") || die "$!";
108 open(FP, ">$dest/$base/$_") or die "$_ $!";
109 print FP "update $_\n";
111 } grep { ! /^\./ && -f $_ } readdir(DIR);
118 cat <<END_OF_DATA >${tmp}/bconcmds
124 @$out ${tmp}/log2.out
126 restore where=${tmp}/bacula-restores storage=File select all done yes
136 check_for_zombie_jobs storage=File
142 find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
144 rm -rf ${tmp}/bacula-restores