projects
/
usenet
/
newsstats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'thh-restructure' into next
[usenet/newsstats.git]
/
bin
/
gatherstats.pl
diff --git
a/bin/gatherstats.pl
b/bin/gatherstats.pl
index
f545456
..
6096417
100755
(executable)
--- a/
bin/gatherstats.pl
+++ b/
bin/gatherstats.pl
@@
-4,12
+4,12
@@
#
# This script will gather statistical information from a database
# containing headers and other information from a INN feed.
#
# This script will gather statistical information from a database
# containing headers and other information from a INN feed.
-#
+#
# It is part of the NewsStats package.
#
# Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
#
# It is part of the NewsStats package.
#
# Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
#
-# It can be redistributed and/or modified under the same terms under
+# It can be redistributed and/or modified under the same terms under
# which Perl itself is published.
BEGIN {
# which Perl itself is published.
BEGIN {
@@
-38,7
+38,7
@@
my %LegalStats;
### read commandline options
my ($OptCheckgroupsFile,$OptClientsDB,$OptDebug,$OptGroupsDB,$OptTLH,
### read commandline options
my ($OptCheckgroupsFile,$OptClientsDB,$OptDebug,$OptGroupsDB,$OptTLH,
- $OptHostsDB,$OptMonth,$OptRawDB,$OptStatsType,$OptTest);
+ $OptHostsDB,$OptMonth,$OptRawDB,$OptStatsType,$OptTest
,$OptConfFile
);
GetOptions ('c|checkgroups=s' => \$OptCheckgroupsFile,
'clientsdb=s' => \$OptClientsDB,
'd|debug!' => \$OptDebug,
GetOptions ('c|checkgroups=s' => \$OptCheckgroupsFile,
'clientsdb=s' => \$OptClientsDB,
'd|debug!' => \$OptDebug,
@@
-49,11
+49,12
@@
GetOptions ('c|checkgroups=s' => \$OptCheckgroupsFile,
'rawdb=s' => \$OptRawDB,
's|stats=s' => \$OptStatsType,
't|test!' => \$OptTest,
'rawdb=s' => \$OptRawDB,
's|stats=s' => \$OptStatsType,
't|test!' => \$OptTest,
+ 'conffile=s' => \$OptConfFile,
'h|help' => \&ShowPOD,
'V|version' => \&ShowVersion) or exit 1;
### read configuration
'h|help' => \&ShowPOD,
'V|version' => \&ShowVersion) or exit 1;
### read configuration
-my %Conf = %{ReadConfig(
''
)};
+my %Conf = %{ReadConfig(
$OptConfFile
)};
### override configuration via commandline options
my %ConfOverride;
### override configuration via commandline options
my %ConfOverride;
@@
-161,7
+162,7
@@
foreach my $Month (&ListMonth($Period)) {
}
};
};
}
};
};
-
+
# delete old data for that month
if (!$OptTest) {
$DBQuery = $DBHandle->do(sprintf("DELETE FROM %s.%s WHERE month = ?",
# delete old data for that month
if (!$OptTest) {
$DBQuery = $DBHandle->do(sprintf("DELETE FROM %s.%s WHERE month = ?",
@@
-207,7
+208,7
@@
gatherstats - process statistical data from a raw source
=head1 SYNOPSIS
=head1 SYNOPSIS
-B<gatherstats> [B<-Vhdt>] [B<-m> I<YYYY-MM> | I<YYYY-MM:YYYY-MM>] [B<-s> I<stats>] [B<-c> I<filename template>]] [B<--hierarchy> I<TLH>] [B<--rawdb> I<database table>] [B<-groupsdb> I<database table>] [B<--clientsdb> I<database table>] [B<--hostsdb> I<database table>]
+B<gatherstats> [B<-Vhdt>] [B<-m> I<YYYY-MM> | I<YYYY-MM:YYYY-MM>] [B<-s> I<stats>] [B<-c> I<filename template>]] [B<--hierarchy> I<TLH>] [B<--rawdb> I<database table>] [B<-groupsdb> I<database table>] [B<--clientsdb> I<database table>] [B<--hostsdb> I<database table>]
[--conffile I<filename>]
=head1 REQUIREMENTS
=head1 REQUIREMENTS
@@
-292,7
+293,7
@@
conjunction with B<--test> ... everything else seems a bit pointless.
Set processing period to a single month in YYYY-MM format or to a time
period between two month in YYYY-MM:YYYY-MM format (two month, separated
Set processing period to a single month in YYYY-MM format or to a time
period between two month in YYYY-MM:YYYY-MM format (two month, separated
-by a colon).
+by a colon).
=item B<-s>, B<--stats> I<type>
=item B<-s>, B<--stats> I<type>
@@
-340,6
+341,10
@@
Override I<DBTableClnts> from F<newsstats.conf>.
Override I<DBTableHosts> from F<newsstats.conf>.
Override I<DBTableHosts> from F<newsstats.conf>.
+=item B<--conffile> I<filename>
+
+Load configuration from I<filename> instead of F<newsstats.conf>.
+
=back
=head1 INSTALLATION
=back
=head1 INSTALLATION
This page took
0.012004 seconds
and
4
git commands to generate.