Skip to main content
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

 

Profile picture for user admin Stephane K

Écrit le

Il y'a 1 year
Modifié
Il y'a 2 weeks
Loading ...
WhatsApp
Support Habeuk : +237 694 900 622
WhatsApp Send