Log file size in Ubuntu?

Posted on

Problem :

If simply movies, tv shows, etc… from a shared folder in windows into a folder in Ubuntu 16 for use with plex and then importing the shows into plex, does this make the usr>log file large and if so, why? How can I safely and correctly reduce the log file size as shown by using Baobab from the 88gb it shows now for log?

Thanks much.

Solution :

You could add a logrotate file to /etc/logrotate.d/
Such as:

/path/to/logfile{
copytruncate
rotate 9
size 5M
compress
missingok
}

Important is the size 5M part (define the size you want) and you have to specify the /path/to/logfile

According to https://serverfault.com/q/147476/391060, logrotate is running daily. You could move /etc/cron.daily/logrotate to /etc/cron.hourly/ so the logs are checked hourly, if the size limit is reached and compress the old log.

Leave a Reply

Your email address will not be published. Required fields are marked *