Linux/Redhat help: truncating apache logs regularly

Greebo

N9017H - C172M (1976)
Joined
Feb 11, 2005
Messages
10,976
Location
Baltimore, MD
Display Name

Display name:
Retired Evil Overlord
Sadly, linux is not my strong suit, but PoA runs on Redhat 9.

Our log files are getting huge. (Like, 4 gigs of logs right now)

I'm looking for a cron-job script that will truncate the logs back to 7 days worth of history, run nightly.

I don't know if I need to shut down apache when I do this or not...

So what I need is someone who's wise in the ways of linux and apache to help me out in creating an appropriate cron job and script to help keep our file space free. :)
 
logrotate is what I use.

There are parameters to rotate them on a schedule or whenever they reach a specific size. How many to keep and a whole lot more.

There is a man page that's pretty decent in RedHat, not sure about the other flavors.

Let me know if you need help configuring it.

Joe
 
Ok, I've copied out the man pages for logrotate. I'll digest them as I am able and come up with a config file later and see if it works.

Then I'll need to figure out how to set up the cron. :)
 
Greebo said:
Ok, I've copied out the man pages for logrotate. I'll digest them as I am able and come up with a config file later and see if it works.

Then I'll need to figure out how to set up the cron. :)
I can't believe I'm saying this, but Windoze AT is a cron wannabe ... pretty similar.

for help -
http://www.uwsg.iu.edu/usail/automation/cron.html or man pages for cron
 
Back
Top