3 # Test if Bacula can handle big fileset
4 # This test create 2M files on a directory and
5 # backup it twice in accurate mode.
7 # Creating 2M files is very long, so the "many-files"
8 # directory isn' cleaned at the end.
11 TestName="big-files-test"
17 echo "${cwd}/many-files" >${cwd}/tmp/file-list
18 if [ ! -f ${cwd}/many-files/100000file100000 ]; then
19 mkdir ${cwd}/many-files
21 print_debug "Creating files..."
22 time perl -e 'for($i=0; $i < 2000000; $i++) {open(FP, ">${i}file${i}") or die "$!"; print FP "$i\n"; close(FP); print "." if ($i%10000);}'
25 sed "s%# Label Format% Label Format%" ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
26 sed "s%Type = Backup%Type = Backup; Accurate = yes" ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
28 change_jobname MonsterFileSet $JobName
31 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
34 @$out ${cwd}/tmp/log1.out
39 @#setdebug level=110 storage=File
40 run job=$JobName storage=File yes
45 SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia
46 FROM JobMedia join Job using (JobId) join Client using (ClientId)
47 where Client.Name = 'localhost-fd' group by JobId, Level, StartTime,
48 JobFiles order by JobId desc ;
51 run job=$JobName storage=File yes
57 @$out ${cwd}/tmp/log2.out
58 @#setdebug level=400 storage=File
59 restore where=${cwd}/tmp/bacula-restores select storage=File
74 check_for_zombie_jobs storage=File || exit 1
79 # we are really more interested to know if backup and restore
80 # worked, but checking the files restored is non-trivial due
81 # to the big fileset exclusions