[Wolves] Help writing a script file
James Rogers
phb01jdr at shef.ac.uk
Thu May 18 15:18:36 BST 2006
Peter Cannon wrote:
> Hi All
>
> Anyone interested in writing a script file? Or giving me an idiots tutorial?
>
> I'd like it to grab the last 10 entries from two logs, combine them into one
> file/email, then email it to me probably via internet rather than local
> delivery.
>
> the locations are
>
> /var/lib/simias/log/adminweb.log
> /var/lib/simias/log/web.log
>
> If possible I'd like the format to be something like
>
> adminweb 18.5.2006 14:52
> =====================================
> Blah blah blah
> Blah blah blah
> Blah blah blah
>
> web 18.5.2006 14:53
> =====================================
> Blah blah blah
> Blah blah blah
> Blah blah blah
>
> I can then setup a cron job. Obviously I'll give the writer full credit.
>
tail -n 10 /var/log/{admin}web.log | mail -s email at address.com
This is off top of the head but it or something very similar should work
tail will supply the log name and time
Jim
More information about the Wolves
mailing list