in reply to Reading Log file from bottom up and take first 100 lines and send email...
One of ways to get 100 lines from bottom will be:use strict; use Win32::OLE; my $service = "Print Spooler"; my $d = Win32::OLE->GetObject("WinNT://domainname"); # ... or just Get +Object("WinNT:") my $c = $d->GetObject("Computer", $opts{computer}); my $s = $c->GetObject("Service", "spooler"); eval {$s->Invoke('Stop');}; sleep 1; eval {$s->Invoke('Start');}; sleep 1;
# unchecked code, sorry. my @x = <FH>; @x = @x[($#x-100>0?$#x-100:0)..$#x];
Courage, the Cowardly Dog
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reading Log file from bottom up and take first 100 lines and send email...
by dws (Chancellor) on Jul 19, 2002 at 06:33 UTC | |
by Abigail-II (Bishop) on Jul 19, 2002 at 12:09 UTC | |
by Courage (Parson) on Jul 19, 2002 at 06:40 UTC | |
|
Re: Re: Reading Log file from bottom up and take first 100 lines and send email...
by Joost (Canon) on Jul 19, 2002 at 14:26 UTC |