3 Users Commented In This Post

Subscribe To This Post Comment Rss Or TrackBack URL
pga says:

just curious… how about using logrotate?

Martin says:

Yes logrotate is a very good option which would have saved me the hassle of dealing with a 45 Gigabyte log file in first place.

Dotan Cohen says:

> It is important to note that you might need to stop
> the Apache web server for the operation to succeed
> because the compression utility will stop if files
> get changed during procession.

How about copying the logfile to another location before compressing? This will of course only be practical if the logile is less than half of your available space, though if that is _not_ your situation then you are in trouble!

This is why logfiles are usually stored in /var and why /var is recommended to be on it’s own partition. When there is a traffic spike Apache logs can grow very fast, and when there are other problems (hardware failure, bad software update, breach) other logfiles can grow very quickly as well. If they are on their own partition they won’t take down the server.

Leave Your Comments Below
Hello, please leave your thought below

Please Note: Each comment will be manually approved by an admin. There is no guarantee that a comment will be posted. Please do not submit the comment multiple times.