Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 3 down vote accepted

Assuming Linux/Unix, logrotate

See: http://www.cyberciti.biz/faq/how-do-i-rotate-log-files/

share|improve this answer
add comment

Your Answer

 
discard

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.