Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, March 28, 2024

File: [Platon] / scripts / perl / accounting / pacct-savelog-mysql.pl (download)

Revision 1.1, Mon Feb 21 11:26:51 2005 UTC (19 years, 1 month ago) by rajo

Process Accounting information parser. Parse pacct dump produced by
dump-acct utility and store them into MySQL database.

#!/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' <rajo AT platon.sk>
# 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 = <STDIN>) {
    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


Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top