Hello, dear monks!
I want to store net-acct's logs in the PostgreSQL database.
Program itself doesn't allow this, so I used File::Tail to consequentally read it's logfile.
But now I have another idea, e.g. to substitute program's logfile with fifo and read the data from it.
I tested it with the following (very simple) script:
#! /usr/bin/perl -w use strict; my $fifo = "/var/log/net-acct/net-acct.log"; while (1) { open(FIFO, "< $fifo") or die "Can't open fifo $fifo: $!\n"; while (<FIFO>) { print; } close(FIFO) or die "Can't close fifo $fifo: $!\n"; }
Everything seems to work just fine, so I want to ask you is there are things I should be aware of then working with named pipes?
Or even more generally is it a good idea at all?
In reply to named pipe question by Kolyan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |