
Ich verwende FreeBSD 8.1. Ich versuche, newsyslog dazu zu bringen, Protokolle zu rotieren, die durch einen dynamischen Pfad definiert sind:
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/path/logs/*.log 644 7 100 $D0 J
/path/logs/*/*.log 644 7 100 $D0 J
Grundsätzlich möchte ich, dass newsyslog alle Dateien mit der Endung .log im Verzeichnis /Pfad/logs/ rotiert.
ich möchte dasselbe auch für alle Unterverzeichnisse von /path/logs/ tun, was die zweite Zeile meiner Konfigurationsdatei ist.
Aber wenn ich das mache:
newsyslog -F
Es werden keine Protokolldateien rotiert.
Antwort1
Die Verwendung der G
Flagge hat /etc/newsyslog.conf
geholfen:
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/path/logs/*.log 644 7 100 $D0 G
/path/logs/*/*.log 644 7 100 $D0 G