Linux Debian, limiting the size of log files, example: syslog
Edit this file: /etc/logrotate.d/rsyslog
sudo nano /etc/logrotate.d/rsyslog
Adjust as follows:
/var/log/syslog
/var/log/mail.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/cron.log
{
rotate 7
size 200M
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
The entries : /var/log/* represent all files that will be affected.
Then restart:
sudo systemctl restart rsyslog
Next, test your configuration:
sudo logrotate -v /etc/logrotate.conf
Loading ...