1 .\" This file contains changes from the Open Software Foundation.
3 .\" from: @(#)newsyslog.8
6 .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology
8 .\" Permission to use, copy, modify, and distribute this software
9 .\" and its documentation for any purpose and without fee is
10 .\" hereby granted, provided that the above copyright notice
11 .\" appear in all copies and that both that copyright notice and
12 .\" this permission notice appear in supporting documentation,
13 .\" and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
14 .\" used in advertising or publicity pertaining to distribution
15 .\" of the software without specific, written prior permission.
16 .\" M.I.T. and the M.I.T. S.I.P.B. make no representations about
17 .\" the suitability of this software for any purpose. It is
18 .\" provided "as is" without express or implied warranty.
25 .Nd maintain system log files to manageable sizes
31 .Op Fl f Ar config_file
34 .Op Oo Fl R Ar tagname Oc Ar
38 utility should be scheduled to run periodically by
40 When it is executed it archives log files if necessary.
42 is determined to require archiving,
44 rearranges the files so that
47 .Dq Va logfile Ns Li \&.0
49 the last period's logs in it,
50 .Dq Va logfile Ns Li \&.1
52 period's logs in it, and so on, up to a user-specified number of
54 It is also possible to let archived log filenames be created using the
55 time the log file was archived instead of the sequential number using
59 Optionally the archived logs can be compressed to save
62 A log can be archived for three reasons:
63 .Bl -enum -offset indent
65 It is larger than the configured size (in kilobytes).
67 A configured number of hours have elapsed since the log was last
70 This is the specific configured hour for rotation of the log.
75 is dependent on how often it is scheduled to run by
77 Since the program is quite fast, it may be scheduled to run every hour
78 without any ill effects,
79 and mode three (above) assumes that this is so.
81 The following options can be used with
83 .Bl -tag -width indent
84 .It Fl f Ar config_file
90 .Pa /etc/newsyslog.conf
91 for its configuration file.
95 into which archived log files will be written.
96 If a relative path is given,
97 it is appended to the path of each log file
98 and the resulting path is used as the directory
99 into which the archived log for that log file will be written.
100 If an absolute path is given,
101 all archived logs are written into the given
103 If any component of the path
106 it will be created when
109 .It Fl d Ar directory
112 which all log files will be relative to.
113 To allow archiving of logs outside the root, the
117 option is unaffected.
122 In this mode it will print out each log and its
123 reasons for either trimming that log or skipping it.
127 not to trim the logs, but to print out what it would do if this option
130 Remove the restriction that
132 must be running as root.
135 will not be able to send a HUP signal to
137 so this option should only be used in debugging.
141 should not send any signals to any daemon processes that it would
142 normally signal when rotating a log file.
143 For any log file which is rotated, this option will usually also
144 mean the rotated log file will not be compressed if there is a
145 daemon which would have been signalled without this option.
146 However, this option is most likely to be useful when specified
149 option, and in that case the compression will be done.
155 logfiles using the specified time format instead of the default
156 sequential filenames.
157 The time format is described in the
162 argument is set to an empty string or the string
164 the default built in time format
168 string is changed the old files created using the previous time format
169 will not be be automatically removed (unless the new format is very
170 similar to the old format).
171 This is also the case when changing from sequential filenames to time
172 based file names, and the other way around.
173 The time format should contain at least year, month, day, and hour to
174 make sure rotating of old logfiles can select the correct logfiles.
176 If specified once, then
178 will create any log files which do not exist, and which have the
180 flag specified in their config file entry.
181 If specified multiple times, then
183 will create all log files which do not already exist.
184 If log files are given on the command-line, then the
188 will only apply to those specific log files.
192 to trim the logs, even if the trim conditions have not been met.
194 option is useful for diagnosing system problems by providing you with
195 fresh logs that contain only the problems.
197 Do not perform any rotations.
198 This option is intended to be used with the
202 options when creating log files is the only objective.
204 Prevent further action if we should send signal but the
206 is empty or does not exist.
210 should rotate a given list of files, even if trim conditions are not
214 is only used in the messages written to the log files which are
216 This differs from the
218 option in that one or more log files must also be specified, so that
220 will only operate on those specific files.
221 This option is mainly intended for the daemons or programs which write
222 some log files, and want to trigger a rotate based on their own criteria.
223 With this option they can execute
225 to trigger the rotate when they want it to happen, and still give the
226 system administrator a way to specify the rules of rotation (such as how
227 many backup copies are kept, and what kind of compression is done).
228 When a daemon does execute
232 option, it should make sure all of the log files are closed before
235 and then it should re-open the files after
238 Usually the calling process will also want to specify the
242 will not send a signal to the very process which called it to force
244 Skipping the signal step will also mean that
246 will return faster, since
248 normally waits a few seconds after any signal that is sent.
257 If additional command line arguments are given,
259 will only examine log files that match those arguments; otherwise, it
260 will examine all files listed in the configuration file.
262 .Bl -tag -width /etc/newsyslog.confxxxx -compact
263 .It Pa /etc/newsyslog.conf
268 Previous versions of the
270 utility used the dot (``.'') character to
271 distinguish the group name.
274 this has been changed to a colon (``:'') character so that user and group
275 names may contain the dot character.
276 The dot (``.'') character is still
277 accepted for backwards compatibility.
283 .Xr newsyslog.conf 5 ,
289 utility originated from
291 and first appeared in
297 Copyright 1987, Massachusetts Institute of Technology
299 Does not yet automatically read the logs to find security breaches.