Logrotate Beispiel nginx

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Die Konfiguration für nginx könnte wie folgt aussehen

  • cat /etc/logrotate.d/nginx
/var/log/nginx/*log {
	daily
	missingok
	rotate 3
	notifempty
	dateext
	dateformat -%Y-%m-%d
	create 640 nginx adm
	compress
	sharedscripts
	postrotate
		test ! -r /run/nginx.pid || kill -USR1 `cat /run/nginx.pid`
	endscript
}