Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^4: Search logs with crontab

by taint (Chaplain)
on Nov 19, 2013 at 15:44 UTC ( #1063350=note: print w/replies, xml ) Need Help??

in reply to Re^3: Search logs with crontab
in thread Search logs with crontab

"As to your original approach with replacing strings, this also can be done, but this requires opening file in "read-write" mode open(FILE, "+<mylog.file")."

There's also a potential "gotcha" here. That being; permissions. The subject file (in +RW) will require the maintenance of not only the current RWX bits, but that the script implementer has sufficient rights, and doesn't change ownership of said file.

All in all, seems keeping markers in a separate file would probably be the most sensible approach -- FAR less overhead.


#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063350]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2018-04-23 12:34 GMT
Find Nodes?
    Voting Booth?