3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Test if Bacula can handle big fileset
9 # This test create 2M files on a directory and
10 # backup it twice in accurate mode.
12 # Creating 2M files is very long, so the "many-files"
13 # directory isn' cleaned at the end.
16 TestName="big-files-test"
22 echo "${cwd}/many-files" >${cwd}/tmp/file-list
23 if [ ! -f ${cwd}/many-files/100000file100000 ]; then
24 mkdir -p ${cwd}/many-files
26 print_debug "Creating 2000000 files..."
27 time perl -e 'for($i=0; $i < 2000000; $i++) {open(FP, ">${i}file${i}") or die "$!"; print FP "$i\n"; close(FP); print "\r$i " if ($i%10000);}'
32 sed 's%# Label Format% Label Format%' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
33 # sed 's%Type = Backup%Type = Backup; Accurate = yes%' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
34 sed 's%Type = Backup%Type = Backup%' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
36 change_jobname MonsterFileSet $JobName
39 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
42 @$out ${cwd}/tmp/log1.out
47 @#setdebug level=110 storage=File
48 run job=$JobName storage=File yes
53 SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia
54 FROM JobMedia join Job using (JobId) join Client using (ClientId)
55 where Client.Name = 'localhost-fd' group by JobId, Level, StartTime,
56 JobFiles order by JobId desc ;
59 run job=$JobName storage=File yes
65 @$out ${cwd}/tmp/log2.out
66 @#setdebug level=400 storage=File
67 restore where=${cwd}/tmp/bacula-restores select storage=File
82 check_for_zombie_jobs storage=File || exit 1
87 # we are really more interested to know if backup and restore
88 # worked, but checking the files restored is non-trivial due
89 # to the big fileset exclusions