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.

  • 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

Assuming Linux/Unix, logrotate

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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