From: Eric Covener If given, The spawned program uses the
same stdin, stdout, and stderr as rotatelogs itself, and also inherits
-the environment.-p
programrotatelogs
will execute the specified
+rotatelogs
will execute the specified
program every time a new log file is opened. The filename of the
newly opened file is passed as the first argument to the program. If
executing after a rotation, the old log file is passed as the second
-argument. rotatelogs
does not wait for the specified
+argument.rotatelogs
does not wait for the specified
program to terminate before continuing to operate, and will not log
-any error code returned on termination. The spawned program uses the
+any error code returned on termination.
When two parameters are provided, under some conditions the parameters +will have the same value. For example, if rotation is triggerd but the +portions of the time and date incorporated into the log filename do not change +across the rotation.
+-f
This creates the files /var/log/logfile.yyyy.mm.dd where yyyy is the year, mm is the month, and dd is the day of the month. Logging will switch to a new file every day at midnight, local time.
+ +This creates the files /var/log/logfile.yyyy.mm where
+ yyyy is the year and mm is the month. Every day at midnight, rotation
+ will occur, including running programs specified with -p
.
+ Despite rotation ocurring, the filename will only change on the first
+ rotation of the month. Rotation on other days will continue to output file
+ and append to it.
+