Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^2: Resizing MRTG (RRDTool) logs en-masse

by McDarren (Abbot)
on Nov 30, 2010 at 01:33 UTC ( #874408=note: print w/replies, xml ) Need Help??

in reply to Re: Resizing MRTG (RRDTool) logs en-masse
in thread Resizing MRTG (RRDTool) logs en-masse

Thanks for the feedback, both valid points.

heh... I completely forgot about the rename function ;-)

  • Comment on Re^2: Resizing MRTG (RRDTool) logs en-masse

Replies are listed 'Best First'.
Re^3: Resizing MRTG (RRDTool) logs en-masse
by jwkrahn (Monsignor) on Nov 30, 2010 at 02:23 UTC

    Also,  /.*rrd$/ will match both of the strings  "rrd" and  "rrd\n" so perhaps you should use  /.*rrd\z/ instead.

    Or perhaps even:  'rrd' eq substr( $_, -3 )

      It would be pretty unusual to have a file name that ends with \n, so I see that as an edge case that's probably not worth worrying about.

      It's probably better to have a check after the call to RRDs::info, so I've inserted:

      my $info = RRDs::info "$logsdir/$rrd"; # Check to ensure we actually have a valid rrd file unless ($info->{filename}) { print qq|"$logsdir/$rrd" doesn't appear to be a valid rrd log, + skipping\n|; next; }
      Which does the trick...
      $ touch foo.rrd $ ./ Starting, found 1 rrd files Processing foo.rrd "./foo.rrd" doesn't appear to be a valid rrd log, skipping Finished, processed 1 files in 0.00 seconds

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://874408]
[Corion]: 1nickt: I imagine (heh) that Agile done somewhat right will make the process (and why we postpone things) somewhat more explicit to the outsider, or at least the "who do we ask to postpone X"

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2017-12-11 12:04 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (289 votes). Check out past polls.