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
10 .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology
12 .\" Permission to use, copy, modify, and distribute this software
13 .\" and its documentation for any purpose and without fee is
14 .\" hereby granted, provided that the above copyright notice
15 .\" appear in all copies and that both that copyright notice and
16 .\" this permission notice appear in supporting documentation,
17 .\" and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
18 .\" used in advertising or publicity pertaining to distribution
19 .\" of the software without specific, written prior permission.
20 .\" M.I.T. and the M.I.T. S.I.P.B. make no representations about
21 .\" the suitability of this software for any purpose. It is
22 .\" provided "as is" without express or implied warranty.
35 file is used to set log file rotation configuration for the
38 Configuration may designate that logs are rotated based on
39 size, last rotation time, or time of day.
42 file can also be used to designate secure permissions to log
43 files at rotation time.
44 During initialization,
46 reads a configuration file,
48 .Pa /etc/newsyslog.conf ,
49 to determine which logs may potentially be rotated and archived.
50 Each line has five mandatory fields and four optional fields,
51 separated with whitespace.
52 Blank lines or lines beginning with
57 is placed in the middle of the line, the
59 character and the rest of the line after it is ignored.
60 To prevent special meaning, the
62 character may be escaped with
64 in this case preceding
68 is treated as an ordinary character.
69 The fields of the configuration file are as follows:
70 .Bl -tag -width indent
72 Name of the system log file to be archived,
73 or one of the literal strings
77 The special default entry will only be used if a log file
78 name is given as a command line argument to
80 and if that log file name is not matched by any other
81 line in the configuration file.
82 The include entry is used to include other configuration
83 files and supports globbing.
84 .It Ar owner : Ns Ar group
85 This optional field specifies the owner and group for the archive file.
88 is essential regardless if the
92 field is left blank or contains a value.
93 The field may be numeric, or a name which is present in
98 Specify the file mode of the log file and archives.
100 Specify the maximum number of archive files which may exist.
101 This does not consider the current log file.
103 When the size of the log file reaches
105 in kilobytes, the log file will be trimmed as described above.
106 If this field contains an asterisk
108 the log file will not be trimmed based on size.
112 field may consist of an interval, a specific time, or both.
115 field contains an asterisk
117 log rotation will solely depend on the contents of the
122 field consists of an optional interval in hours, usually followed
124 .So Li \&@ Sc Ns No -sign
125 and a time in restricted
128 Additionally, the format may also be constructed with a
130 sign along with a rotation time specification of once
131 a day, once a week, or once a month.
133 If a time is specified, the log file will only be trimmed if
135 is run within one hour of the specified time.
136 If an interval is specified, the log file will be trimmed if that many
137 hours have passed since the last rotation.
138 When both a time and an interval are
139 specified then both conditions must be satisfied for the rotation to
142 There is no provision for the specification of a timezone.
143 There is little point in specifying an explicit minutes or
144 seconds component in the current implementation, since the only comparison is
145 .Dq within the hour .
147 .Sy ISO 8601 restricted time format :
149 The lead-in character for a restricted
154 The particular format of the time in restricted
159 .Op Oo Oo Oo Va cc Oc Va yy Oc Va mm Oc Va dd
162 .Op Va hh Oo Va mm Oo Va ss Oc Oc Oc
165 Optional date fields default to the appropriate component of the
166 current date; optional time fields default to midnight; hence if today
167 is January 22, 1999, the following date specifications are all
170 .Bl -item -compact -offset indent
172 .Sq Li 19990122T000000
193 .Sy Day, week, and month time format:
195 The lead-in character for day, week, and month specification is a
198 The particular format of day, week, and month specification is:
200 .Op Li W Ns Va w Ns Op Li D Ns Va hh ,
202 .Op Li M Ns Va dd Ns Op Li D Ns Va hh ,
204 Optional time fields default to midnight.
205 The ranges for day and hour specifications are:
207 .Bl -tag -width indent -offset indent -compact
211 day of week, range 0..6, 0 = Sunday
213 day of month, range 1..31, or one of the letters
217 to specify the last day of the month.
222 .Bl -tag -width indent -offset indent -compact
224 rotate every night at midnight
228 rotate every day at 23:00
232 rotate every week on Sunday at 23:00
234 rotate every week on Friday at 16:00
236 rotate at the first day of every month at midnight
237 (i.e., the start of the day; same as
240 rotate on every 5th day of month at 6:00
245 This optional field is made up of one or more characters
246 that specify any special processing to be done for the log
247 files matched by this line.
248 The following are valid flags:
249 .Bl -tag -width indent
251 indicates that the log file is a binary file, or has some
257 message into a log file during rotation.
258 This message is used to indicate
259 when, and sometimes why the log file was rotated.
262 is specified, then that informational message will not be
263 inserted into the log file.
265 indicates that the log file should be created if it does not
266 already exist, and if the
268 option was also specified on the command line.
274 flag when creating a new version of
276 This option would affect how the
278 command treats the log file when making a file system backup.
280 indicates that the specified
282 is a shell pattern, and that
284 should archive all filenames matching that pattern using the
285 other options on this line.
288 for details on syntax and matching rules.
292 should attempt to save disk space by compressing the rotated
298 should attempt to save disk space by compressing the rotated
302 indicates that there is no process which needs to be signaled
303 when this log file is rotated.
305 if this flag is set the
307 will run executable defined in
308 .Ar path_to_pid_cmd_file
309 after rotation instead of trying to send signal to a process id
312 indicates that the file specified by
313 .Ar path_to_pid_cmd_file
314 will contain the ID for a process group instead of a process.
315 This option also requires that the first line in that file
316 be a negative value to distinguish it from a process ID.
320 should attempt to save disk space by compressing the rotated
324 a minus sign will not cause any special processing, but it
325 can be used as a placeholder to create a
327 field when you need to specify any of the following fields.
329 .It Ar path_to_pid_cmd_file
330 This optional field specifies the file name containing a daemon's
331 process ID or to find a group process ID if the
334 If this field is present, a
336 is sent to the process ID contained in this file.
337 If this field is not present and the
339 flag has not been specified, then a
341 signal will be sent to
343 or to the process id found in the file specified by
344 .Xr newsyslog 8 Ns 's
347 This field must start with
349 in order to be recognized properly.
352 flag, the file is treated as a path to a binary to be executed
355 after rotation instead of sending the signal out.
357 This optional field specifies the signal number that will be sent
358 to the daemon process (or to all processes in a process group, if the
361 If this field is not present, then a
366 The following is an example of the
369 .Dl "<include> /etc/newsyslog-local.conf"
379 This manual page first appeared in