TRIMMING THE LOG

Various unix processes can
produce fast growing logs that
sometimes need to be trimmed
instead of deleted, for reference
or troubleshooting. And you
likely have no desire to edit the
files. Here is a handy ksh
script that will quickly trim
the log so it keeps recent
information and lets you keep as
many lines as you think you might
need. I call it trimlog:

Use it by feeding in the name of
the log you want to trim followed
by the number of lines you want to
keep:

# trimlog oracle_listener.log 10000

Of course you can't use it in
the /tmp directory. There are
probably newer and more efficient
ways to do this, but this works. NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.