Re: Pipes and bash scripts
From: Mr. Schnibitz (schnibitz_at_hotmail.com)
Date: 06/05/04
- Next message: Pat LaVarre: "repeat for more GB/min of pseudo random"
- Previous message: Michael Heiming: "Re: User logoff"
- In reply to: Barry Margolin: "Re: Pipes and bash scripts"
- Next in thread: Barry Margolin: "Re: Pipes and bash scripts"
- Reply: Barry Margolin: "Re: Pipes and bash scripts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 4 Jun 2004 17:03:00 -0700
Thanks for responding. I DO want it to want it to check for more
data. It is reading data from the log-file, and piping it to the
perl-script, so that it can eventually go into the database. That is
the only way it will update the database.
Thanks,
C:\Mark
Barry Margolin <barmar@alum.mit.edu> wrote in message news:<barmar-7CBF94.08230004062004@comcast.dca.giganews.com>...
> In article <11232337.0406032016.67a5f88f@posting.google.com>,
> schnibitz@hotmail.com (Mr. Schnibitz) wrote:
>
> > All,
> > I am tying to get what is written to a log file into a MySQL database.
> >
> > If I set up a named pipe and run the following from a bash script:
> >
> > /sbin/converter.pl < /var/log/syslog &
> >
> > Where "syslog" is a named pipe, it (the pipe) fills up too quickly,
> > and I get an error.
>
> What error? When the pipe fills up, the writer should simply block
> until the reader catches up.
>
> >
> > If I make the syslog a normal file, and do a:
> >
> > tail -n 0 -f /var/log/syslog|/sbin/converter.pl &
> >
> > It runs great, but when called from a bash script, it won't exit when
> > the function that called it dies. For instance, if I call it while
> > starting a service, when the service dies or stops, it still is
> > active, even though the first one (above) does die properly. This is
> > extremely frustrating, can someone help me get it so that I can get it
> > to read the log properly AND it exits when it is supposed to? I tried
> > changing the pipe size in limits.h, but it didn't seem to work. Maybe
> > there is a way to re-write the "tail" line so that it exits when it is
> > supposed to?
>
> The -f command tells tail to keep checking for more data; why are you
> using that option if you don't want it to do that?
- Next message: Pat LaVarre: "repeat for more GB/min of pseudo random"
- Previous message: Michael Heiming: "Re: User logoff"
- In reply to: Barry Margolin: "Re: Pipes and bash scripts"
- Next in thread: Barry Margolin: "Re: Pipes and bash scripts"
- Reply: Barry Margolin: "Re: Pipes and bash scripts"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|