Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-08-19 23:08 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (312 votes). Check out past polls.