1 .\" This file was split from the newsyslog(8) manual page by Tom Rhodes
2 .\" and includes modifications as appropriate.
3 .\" The original header is included below:
5 .\" This file contains changes from the Open Software Foundation.
7 .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology
9 .\" Permission to use, copy, modify, and distribute this software
10 .\" and its documentation for any purpose and without fee is
11 .\" hereby granted, provided that the above copyright notice
12 .\" appear in all copies and that both that copyright notice and
13 .\" this permission notice appear in supporting documentation,
14 .\" and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
15 .\" used in advertising or publicity pertaining to distribution
16 .\" of the software without specific, written prior permission.
17 .\" M.I.T. and the M.I.T. S.I.P.B. make no representations about
18 .\" the suitability of this software for any purpose. It is
19 .\" provided "as is" without express or implied warranty.
32 file is used to set log file rotation configuration for the
35 Configuration may designate that logs are rotated based on
36 size, last rotation time, or time of day.
39 file can also be used to designate secure permissions to log
40 files at rotation time.
41 During initialization,
43 reads a configuration file,
45 .Pa /etc/newsyslog.conf ,
46 to determine which logs may potentially be rotated and archived.
47 Each line has five mandatory fields and four optional fields,
48 separated with whitespace.
49 Blank lines or lines beginning with
54 is placed in the middle of the line, the
56 character and the rest of the line after it is ignored.
57 To prevent special meaning, the
59 character may be escaped with
61 in this case preceding
65 is treated as an ordinary character.
66 The fields of the configuration file are as follows:
67 .Bl -tag -width indent
69 Name of the system log file to be archived,
70 or one of the special strings
76 which should be placed at the beginning of the
79 sets the global compress method.
80 This method is applied when a log file is flagged as
82 which has the same effect of passing a compress method to the
87 The special <default> entry will only be used if a log file
88 name is given as a command line argument to
90 and if that log file name is not matched by any other
91 line in the configuration file.
92 The include entry is used to include other configuration
93 files and supports globbing.
94 .It Ar owner : Ns Ar group
95 This optional field specifies the owner and group for the archive file.
98 is essential regardless if the
102 field is left blank or contains a value.
103 The field may be numeric, or a name which is present in
108 Specify the file mode of the log file and archives.
111 (That is, read and write permissions for the rotated log may be specified for
112 the owner, group, and others.)
113 All other mode bits are ignored.
115 Specify the maximum number of archive files which may exist.
116 This does not consider the current log file.
118 When the size of the log file reaches
120 in kilobytes, the log file will be trimmed as described above.
121 If this field contains an asterisk
123 the log file will not be trimmed based on size.
127 field may consist of an interval, a specific time, or both.
130 field contains an asterisk
132 log rotation will solely depend on the contents of the
137 field consists of an optional interval in hours, usually followed
139 .So Li \&@ Sc Ns No -sign
140 and a time in restricted
143 Additionally, the format may also be constructed with a
145 sign along with a rotation time specification of once
146 a day, once a week, or once a month.
148 Time based trimming happens only if
150 is run within one hour of the specified time.
151 If an interval is specified, the log file will be trimmed if that many
152 hours have passed since the last rotation.
153 When both a time and an interval are
154 specified then both conditions must be satisfied for the rotation to
157 There is no provision for the specification of a timezone.
158 There is little point in specifying an explicit minutes or
159 seconds component in the current implementation, since the only comparison is
160 .Dq within the hour .
162 .Sy ISO 8601 restricted time format :
164 The lead-in character for a restricted
169 The particular format of the time in restricted
185 Optional date fields default to the appropriate component of the
186 current date; optional time fields default to midnight; hence if today
187 is January 22, 1999, the following date specifications are all
190 .Bl -item -compact -offset indent
192 .Sq Li 19990122T000000
213 .Sy Day, week, and month time format:
215 The lead-in character for day, week, and month specification is a
218 The particular format of day, week, and month specification is:
220 .Op Li W Ns Va w Ns Op Li D Ns Va hh ,
222 .Op Li M Ns Va dd Ns Op Li D Ns Va hh ,
224 Optional time fields default to midnight.
225 The ranges for day and hour specifications are:
227 .Bl -tag -width indent -offset indent -compact
231 day of week, range 0..6, 0 = Sunday
233 day of month, range 1..31, or one of the letters
237 to specify the last day of the month.
242 .Bl -tag -width indent -offset indent -compact
244 rotate every night at midnight
248 rotate every day at 23:00
252 rotate every week on Sunday at 23:00
254 rotate every week on Friday at 16:00
256 rotate at the first day of every month at midnight
257 (i.e., the start of the day; same as
260 rotate on every fifth day of month at 6:00
265 This optional field is made up of one or more characters
266 that specify any special processing to be done for the log
267 files matched by this line.
268 The following are valid flags:
269 .Bl -tag -width indent
271 indicates that the log file is a binary file, or has some
277 message into a log file during rotation.
278 This message is used to indicate
279 when, and sometimes why the log file was rotated.
282 is specified, then that informational message will not be
283 inserted into the log file.
285 indicates that the log file should be created if it does not
286 already exist, and if the
288 option was also specified on the command line.
294 flag when creating a new version of
296 This option would affect how the
298 command treats the log file when making a file system backup.
300 indicates that the log file should not be rotated when its
304 flag is mostly useful in conjunction with
308 from inserting an informational
310 message into the new file.
312 indicates that the specified
314 is a shell pattern, and that
316 should archive all filenames matching that pattern using the
317 other options on this line.
320 for details on syntax and matching rules.
324 should consider the rotated log file as compressible.
331 indicates that there is no process which needs to be signaled
332 when this log file is rotated.
334 indicates that the zero-th rotated file should not be compressed.
336 if this flag is set the
338 will run shell command defined in
339 .Ar path_to_pid_cmd_file
340 after rotation instead of trying to send signal to a process id
343 if this flag is set the informational rotation message written to
344 the log file will be in the format specified by RFC5424.
345 Normally, the rotation message is written in the traditional (RFC3164)
348 indicates that the file specified by
349 .Ar path_to_pid_cmd_file
350 will contain the ID for a process group instead of a process.
351 This option also requires that the first line in that file
352 be a negative value to distinguish it from a process ID.
356 should consider the rotated log file as compressible.
365 should consider the rotated log file as compressible.
374 should consider the rotated log file as compressible.
381 a minus sign will not cause any special processing, but it
382 can be used as a placeholder to create a
384 field when you need to specify any of the following fields.
386 .It Ar path_to_pid_cmd_file
387 This optional field specifies the file name containing a daemon's
388 process ID or to find a group process ID if the
391 If this field is present, a
393 is sent to the process ID contained in this file.
394 If this field is not present and the
396 flag has not been specified, then a
398 signal will be sent to
400 or to the process id found in the file specified by
401 .Xr newsyslog 8 Ns 's
404 This field must start with
406 in order to be recognized properly.
409 flag, the file is treated as a path to a binary to be executed
412 after rotation instead of sending the signal out.
414 This optional field specifies the signal that will be sent to the daemon
415 process (or to all processes in a process group, if the
418 If this field is not present, then a
424 and be the signal name, e.g.,
428 can be the signal number, e.g., 30 for
432 The following is an example of the
435 .Dl "<include> /etc/newsyslog-local.conf"
448 .%T The BSD syslog Protocol
453 .%T The Syslog Protocol
457 This manual page first appeared in