[95999] in RedHat Linux List
Re: What's the best way to trim log files?
daemon@ATHENA.MIT.EDU (Steve Hazelett)
Thu Oct 22 21:51:07 1998
From: Steve Hazelett <hazelett@aa.net>
Date: Thu, 22 Oct 1998 18:49:18 -0700 (PDT)
To: redhat-list@redhat.com
In-Reply-To: <199810221645.MAA02543@brazil.ca.boeing.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Ray,
Depending upon what version of RH your running there already exists a
way of doing it. It's called logrotate and should have been in your
/etc/crontab file when you installed RH.
Actually the program is run-parts. Here's what my crontab file looks
like:
#01 * * * * root run-parts /etc/cron.hourly
#30 02 * * * root run-parts /etc/cron.daily
00 11 * * * root run-parts /etc/cron.daily
#02 2 * * 0 root run-parts /etc/cron.weekly
#02 3 1 * * root run-parts /etc/cron.monthly
I only run one of these (the uncommented one) daily. The program
run-parts will execute everything in /etc/cron.daily if the programs are
chmoded to execute. If you go into /etc/cron.daily you will find a file
called log-rotate which is executed and simply runs logrotate calling
out the logrotate.conf file as it's configuration. If you edit
/etc/logrotate.conf you will find several options in there to rotate
your log files. There are options to compress them or not, keep them
for as many weeks as you like. There are several options in that file.
Take a look at it and configure it like you want, then set up your
crontab file to run it as you like (see above).
If you have further questions, don't hesitate to send me a private
Email, I'd be happy to help.
... Steve
"Raymond H. Kraft" <ray@brazil.ca.boeing.com> wrote:
> Hi,
>
> I've got some log files that are getting rather large, and was
> wondering what
> the best was is to trim them down.
>
> Thanks in advance.
>
> -Ray Kraft
> Seattle, Washington
>
>
>
> --
>
> Ray Kraft | Boeing Seattle | ray@brazil.ca.boeing.com | (425) 965-2015
> PGP fingerprint: D5 12 C9 9E DE FA B2 FF AA D9 F7 FB B5 9F 63 7D
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Windows95: win-doz-nin-te-fiv> n.
> 32 bit extensions and a graphical shell for a 16 bit patch to an 8 bit
> operating system originally coded for a 4 bit microprocessor, written
> by a
> 2 bit company that can't stand 1 bit of competition.
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hazelett@aa.net
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.