Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my particular case it's the mysql general log and slow query log; neither is critical to operations, just there for troubleshooting if need be, and mysql doesn't have a mechanism for rolling or truncating either of them. These logs can grow ridiculously large if neglected. Is there a nice little cron-job+bash-script hack for rolling or truncating these files? Thanks.

share|improve this question
The references to cron, etc. imply *nix but please add the appropriate tag so we don't have to guess. – John Gardeniers Oct 22 '09 at 21:11
up vote 5 down vote accepted

Assuming Linux/Unix, logrotate


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.