#!/usr/bin/perl # # pacct-savelog-mysql.pl - parse dump from dump-acct # (process accounting in human readable form) # and store information into MySQL database. # # Developed by Lubomir Host 'rajo' # Copyright (c) 2005 Platon SDG, http://platon.sk/ # Licensed under terms of GNU General Public License. # All rights reserved. # # Changelog: # 2005-02-20 - created # # Usage: # # Download Platon's Perl modules from http://platon.sk/cvs/cvs.php/perl-modules/ # # $Platon$ use strict; use FindBin; use lib "$FindBin::Bin/../../../perl-modules"; use lib "$FindBin::Bin/perl-modules"; use Platon::Log::Accounting::Process; use vars qw($VERSION $DEBUG); use vars qw ( $conf ); $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); $DEBUG = 0 unless defined $DEBUG; $\ = "\n"; $| = 1; $conf = undef; # use defaults from Platon::Mail.pm my $log = Platon::Log::Accounting::Process->new($conf); print STDERR "# Platon::Log::Accounting::Process module version " . $log->version; my $nr = 0; while (my $line = ) { chomp $line; $nr++; $log->savelog($line) or print STDERR "Error saving log entry #$nr: '$line'"; } # vim: ts=4 # vim600: fdm=marker fdl=0 fdc=3