version 1.1, 2003/12/09 20:17:48
|
version 1.3, 2005/05/14 19:37:47
|
Line 41 print "\nUpdating access count storage.
|
Line 41 print "\nUpdating access count storage.
|
my $logfile = '/tmp/accesscount_update_log.txt'; |
my $logfile = '/tmp/accesscount_update_log.txt'; |
|
|
# get a list of all user directories |
# get a list of all user directories |
|
print "Getting directory listing.\n"; |
my @dirs=`find <TARGET /> -type d `; |
my @dirs=`find <TARGET /> -type d `; |
my @userdirs=grep(m|/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*|, @dirs); |
my @userdirs=grep(m|/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*|, @dirs); |
|
|
my $count = 0; |
my $count = 0; |
my $countby = 20; |
my $countby = 1; |
print "Updating ".scalar(@userdirs)." files. Each '.' represents ".$countby. |
print "Updating ".scalar(@userdirs)." files.\n"; |
" files processed.\n"; |
|
foreach my $udir (@userdirs) { |
foreach my $udir (@userdirs) { |
if (++$count % $countby == 0) { |
if (++$count % $countby == 0) { |
print "."; |
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"; |
|
print $count."/".scalar(@userdirs); |
} |
} |
chomp($udir); |
chomp($udir); |
my $file = $udir.'/nohist_resevaldata.db'; |
my $file = $udir.'/nohist_resevaldata.db'; |
next if (! -e $file); |
next if (! -e $file); |
|
next if (-e $udir.'/nohist_accesscount.db'); |
system('/home/httpd/perl/seed_accesscount.pl '.$file. |
system('/home/httpd/perl/seed_accesscount.pl '.$file. |
' 2>>'.$logfile); |
' 2>>'.$logfile); |
} |
} |