Extending sr_'s comment, I'm using logrotate to housekeep a nightly SQL dump. I have this configuration in
create 640 root root
It basically takes the
/var/backups/dump.sql file (you would specify the name of your logfile instead), compresses it and renames it to
dump.sql.1.gz. Before that, it rotates the old
dump.sql.2.gz and so on, and deletes the oldest one.
logrotate itself is usually called by
cron, so have a look at your
/etc/cron* directories to control when it's run.