A Linux service is creating a huge log file.
At the moment I am keeping it under control using cron (every X minutes I reduce it to the last X lines):
*/5 * * * * root echo "$(tail -n 1000 /var/log/XXX/logger_file.log)" > /var/log/XXX/logger_file.log
Is there any other way to do the job in a cleaner way?
The first line, after the cut, can even be damaged if the chars cut is size based (i.e. keep the last 1024 bytes).
Of course I cannot modify the service itself to keep quiet.