Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 22. júl 2024

Súbor: [Platon] / scripts / perl / accounting / pacct-savelog-mysql.pl (stiahnutie)

Revízia 1.1, Mon Feb 21 11:26:51 2005 UTC (19 years, 5 months 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.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok