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 .\" from: @(#)newsyslog.8
9 .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology
11 .\" Permission to use, copy, modify, and distribute this software
12 .\" and its documentation for any purpose and without fee is
13 .\" hereby granted, provided that the above copyright notice
14 .\" appear in all copies and that both that copyright notice and
15 .\" this permission notice appear in supporting documentation,
16 .\" and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
17 .\" used in advertising or publicity pertaining to distribution
18 .\" of the software without specific, written prior permission.
19 .\" M.I.T. and the M.I.T. S.I.P.B. make no representations about
20 .\" the suitability of this software for any purpose. It is
21 .\" provided "as is" without express or implied warranty.
34 file is used to set log file rotation configuration for the
37 Configuration may designate that logs are rotated based on
38 size, last rotation time, or time of day.
41 file can also be used to designate secure permissions to log
42 files at rotation time.
43 During initialization,
45 reads a configuration file,
47 .Pa /etc/newsyslog.conf ,
48 to determine which logs may potentially be rotated and archived.
49 Each line has five mandatory fields and four optional fields,
50 separated with whitespace.
51 Blank lines or lines beginning with
56 is placed in the middle of the line, the
58 character and the rest of the line after it is ignored.
59 To prevent special meaning, the
61 character may be escaped with
63 in this case preceding
67 is treated as an ordinary character.
68 The fields of the configuration file are as follows:
69 .Bl -tag -width indent
71 Name of the system log file to be archived,
72 or one of the literal strings
76 The special default entry will only be used if a log file
77 name is given as a command line argument to
79 and if that log file name is not matched by any other
80 line in the configuration file.
81 The include entry is used to include other configuration
82 files and supports globbing.
83 .It Ar owner : Ns Ar group
84 This optional field specifies the owner and group for the archive file.
87 is essential regardless if the
91 field is left blank or contains a value.
92 The field may be numeric, or a name which is present in
97 Specify the file mode of the log file and archives.
100 (That is, read and write permissions for the rotated log may be specified for
101 the owner, group, and others.)
102 All other mode bits are ignored.
104 Specify the maximum number of archive files which may exist.
105 This does not consider the current log file.
107 When the size of the log file reaches
109 in kilobytes, the log file will be trimmed as described above.
110 If this field contains an asterisk
112 the log file will not be trimmed based on size.
116 field may consist of an interval, a specific time, or both.
119 field contains an asterisk
121 log rotation will solely depend on the contents of the
126 field consists of an optional interval in hours, usually followed
128 .So Li \&@ Sc Ns No -sign
129 and a time in restricted
132 Additionally, the format may also be constructed with a
134 sign along with a rotation time specification of once
135 a day, once a week, or once a month.
137 Time based trimming happens only if
139 is run within one hour of the specified time.
140 If an interval is specified, the log file will be trimmed if that many
141 hours have passed since the last rotation.
142 When both a time and an interval are
143 specified then both conditions must be satisfied for the rotation to
146 There is no provision for the specification of a timezone.
147 There is little point in specifying an explicit minutes or
148 seconds component in the current implementation, since the only comparison is
149 .Dq within the hour .
151 .Sy ISO 8601 restricted time format :
153 The lead-in character for a restricted
158 The particular format of the time in restricted
174 Optional date fields default to the appropriate component of the
175 current date; optional time fields default to midnight; hence if today
176 is January 22, 1999, the following date specifications are all
179 .Bl -item -compact -offset indent
181 .Sq Li 19990122T000000
202 .Sy Day, week, and month time format:
204 The lead-in character for day, week, and month specification is a
207 The particular format of day, week, and month specification is:
209 .Op Li W Ns Va w Ns Op Li D Ns Va hh ,
211 .Op Li M Ns Va dd Ns Op Li D Ns Va hh ,
213 Optional time fields default to midnight.
214 The ranges for day and hour specifications are:
216 .Bl -tag -width indent -offset indent -compact
220 day of week, range 0..6, 0 = Sunday
222 day of month, range 1..31, or one of the letters
226 to specify the last day of the month.
231 .Bl -tag -width indent -offset indent -compact
233 rotate every night at midnight
237 rotate every day at 23:00
241 rotate every week on Sunday at 23:00
243 rotate every week on Friday at 16:00
245 rotate at the first day of every month at midnight
246 (i.e., the start of the day; same as
249 rotate on every fifth day of month at 6:00
254 This optional field is made up of one or more characters
255 that specify any special processing to be done for the log
256 files matched by this line.
257 The following are valid flags:
258 .Bl -tag -width indent
260 indicates that the log file is a binary file, or has some
266 message into a log file during rotation.
267 This message is used to indicate
268 when, and sometimes why the log file was rotated.
271 is specified, then that informational message will not be
272 inserted into the log file.
274 indicates that the log file should be created if it does not
275 already exist, and if the
277 option was also specified on the command line.
283 flag when creating a new version of
285 This option would affect how the
287 command treats the log file when making a file system backup.
289 indicates that the log file should not be rotated when its
293 flag is mostly useful in conjunction with
297 from inserting an informational
299 message into the new file.
301 indicates that the specified
303 is a shell pattern, and that
305 should archive all filenames matching that pattern using the
306 other options on this line.
309 for details on syntax and matching rules.
313 should attempt to save disk space by compressing the rotated
317 indicates that there is no process which needs to be signaled
318 when this log file is rotated.
320 indicates that the zero-th rotated file should not be compressed.
322 if this flag is set the
324 will run shell command defined in
325 .Ar path_to_pid_cmd_file
326 after rotation instead of trying to send signal to a process id
329 if this flag is set the informational rotation message written to
330 the log file will be in the format specified by RFC5424.
331 Normally, the rotation message is written in the traditional (RFC3164)
334 indicates that the file specified by
335 .Ar path_to_pid_cmd_file
336 will contain the ID for a process group instead of a process.
337 This option also requires that the first line in that file
338 be a negative value to distinguish it from a process ID.
342 should attempt to save disk space by compressing the rotated
348 should attempt to save disk space by compressing the rotated
354 should attempt to save disk space by compressing the rotated
358 a minus sign will not cause any special processing, but it
359 can be used as a placeholder to create a
361 field when you need to specify any of the following fields.
363 .It Ar path_to_pid_cmd_file
364 This optional field specifies the file name containing a daemon's
365 process ID or to find a group process ID if the
368 If this field is present, a
370 is sent to the process ID contained in this file.
371 If this field is not present and the
373 flag has not been specified, then a
375 signal will be sent to
377 or to the process id found in the file specified by
378 .Xr newsyslog 8 Ns 's
381 This field must start with
383 in order to be recognized properly.
386 flag, the file is treated as a path to a binary to be executed
389 after rotation instead of sending the signal out.
391 This optional field specifies the signal that will be sent to the daemon
392 process (or to all processes in a process group, if the
395 If this field is not present, then a
401 and be the signal name, e.g.,
405 can be the signal number, e.g., 30 for
409 The following is an example of the
412 .Dl "<include> /etc/newsyslog-local.conf"
425 .%T The BSD syslog Protocol
430 .%T The Syslog Protocol
434 This manual page first appeared in