Logrotate Beispiel nginx: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „ *Die Konfiguration für nginx könnte wie folgt aussehen: <pre> /var/log/nginx/*log { daily missingok rotate 3 notifempty dateext dateformat -%Y-%m-%d…“)
 
 
Zeile 1: Zeile 1:
  
*Die Konfiguration für nginx könnte wie folgt aussehen:
+
=Die Konfiguration für nginx könnte wie folgt aussehen=
 +
*cat /etc/logrotate.d/nginx
 
<pre>
 
<pre>
 
/var/log/nginx/*log {
 
/var/log/nginx/*log {
Zeile 9: Zeile 10:
 
dateext
 
dateext
 
dateformat -%Y-%m-%d
 
dateformat -%Y-%m-%d
create 640 http log
+
create 640 nginx adm
 
compress
 
compress
 
sharedscripts
 
sharedscripts

Aktuelle Version vom 26. März 2025, 19:22 Uhr

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
}