X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=bin%2Ffeedlog.pl;h=27cc75a633fc75d5a1b323a37a292e9764c01d3b;hp=7c64cab725ae1c4bf7668036c0ac11d23a3e8145;hb=91c674c4fe8136657b3bfc5c862e0c096ea2dd87;hpb=dfc2b81c37c38c2b7bcc8afeead0ec927845b90f diff --git a/bin/feedlog.pl b/bin/feedlog.pl index 7c64cab..27cc75a 100755 --- a/bin/feedlog.pl +++ b/bin/feedlog.pl @@ -13,7 +13,7 @@ # which Perl itself is published. BEGIN { - our $VERSION = "0.01"; + our $VERSION = "0.02"; use File::Basename; # we're in .../bin, so our module is in ../lib push(@INC, dirname($0).'/../lib'); @@ -69,14 +69,15 @@ sub PrepareDB { ################################# Main program ################################# ### read commandline options -my ($OptDebug,$OptQuiet); +my ($OptDebug,$OptQuiet,$OptConfFile); GetOptions ('d|debug!' => \$OptDebug, 'q|test!' => \$OptQuiet, + 'conffile=s' => \$OptConfFile, 'h|help' => \&ShowPOD, 'V|version' => \&ShowVersion) or exit 1; ### read configuration -my %Conf = %{ReadConfig('')}; +my %Conf = %{ReadConfig($OptConfFile)}; ### init syslog openlog($0, 'nofatal,pid', LOG_NEWS); @@ -130,7 +131,7 @@ while (<>) { }; }; $DBQuery->finish; - + warn sprintf("-----\nDay: %s\nDate: %s\nMID: %s\nTS: %s\nToken: %s\n". "Size: %s\nPeer: %s\nPath: %s\nNewsgroups: %s\nHeaders: %s\n", $Day, $Date, $Mid, $Timestamp, $Token, $Size, $Peer, $Path, @@ -152,7 +153,7 @@ feedlog - log data from an INN feed to a database =head1 SYNOPSIS -B [B<-Vhdq>] +B [B<-Vhdq>] [B<--conffile> I] =head1 REQUIREMENTS @@ -173,7 +174,8 @@ terminating would only result in a rapid respawn. =head2 Configuration B will read its configuration from F which -should be present in the same directory via Config::Auto. +should be present in etc/ via Config::Auto or from a configuration file +submitted by the B<--conffile> option. See L for an overview of possible configuration options. @@ -198,6 +200,10 @@ find that information most probably in your B F file. Suppress logging to syslog. +=item B<--conffile> I + +Load configuration from I instead of F. + =back =head1 INSTALLATION @@ -260,7 +266,7 @@ Thomas Hochstein =head1 COPYRIGHT AND LICENSE -Copyright (c) 2010-2012 Thomas Hochstein +Copyright (c) 2010-2013 Thomas Hochstein This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.