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
32 .Op Fl f Ar config_file
37 utility should be scheduled to run periodically by
39 When it is executed it archives log files if necessary.
41 is determined to require archiving,
43 rearranges the files so that
46 .Dq Va logfile Ns Li \&.0
48 the last period's logs in it,
49 .Dq Va logfile Ns Li \&.1
51 period's logs in it, and so on, up to a user-specified number of
53 Optionally the archived logs can be compressed to save
56 A log can be archived for three reasons:
57 .Bl -enum -offset indent
59 It is larger than the configured size (in kilobytes).
61 A configured number of hours have elapsed since the log was last
64 This is the specific configured hour for rotation of the log.
69 is dependent on how often it is scheduled to run by
71 Since the program is quite fast, it may be scheduled to run every hour
72 without any ill effects,
73 and mode three (above) assumes that this is so.
75 The following options can be used with
77 .Bl -tag -width indent
78 .It Fl f Ar config_file
84 .Pa /etc/newsyslog.conf
85 for its configuration file.
89 into which archived log files will be written.
90 If a relative path is given,
91 it is appended to the path of each log file
92 and the resulting path is used as the directory
93 into which the archived log for that log file will be written.
94 If an absolute path is given,
95 all archived logs are written into the given
97 If any component of the path
100 it will be created when
103 .It Fl d Ar directory
106 which all log files will be relative to.
107 To allow archiving of logs outside the root, the
111 option is unaffected.
116 In this mode it will print out each log and its
117 reasons for either trimming that log or skipping it.
121 not to trim the logs, but to print out what it would do if this option
124 Remove the restriction that
126 must be running as root.
129 will not be able to send a HUP signal to
131 so this option should only be used in debugging.
135 should not send any signals to any daemon processes that it would
136 normally signal when rotating a log file.
137 For any log file which is rotated, this option will usually also
138 mean the rotated log file will not be compressed if there is a
139 daemon which would have been signalled without this option.
140 However, this option is most likely to be useful when specified
143 option, and in that case the compression will be done.
145 If specified once, then
147 will create any log files which do not exist, and which have the
149 flag specified in their config file entry.
150 If specified multiple times, then
152 will create all log files which do not already exist.
153 If log files are given on the command-line, then the
157 will only apply to those specific log files.
161 to trim the logs, even if the trim conditions have not been met.
163 option is useful for diagnosing system problems by providing you with
164 fresh logs that contain only the problems.
166 Do not perform any rotations.
167 This option is intended to be used with the
171 options when creating log files is the only objective.
175 should rotate a given list of files, even if trim conditions are not
179 is only used in the messages written to the log files which are
181 This differs from the
183 option in that one or more log files must also be specified, so that
185 will only operate on those specific files.
186 This option is mainly intended for the daemons or programs which write
187 some log files, and want to trigger a rotate based on their own criteria.
188 With this option they can execute
190 to trigger the rotate when they want it to happen, and still give the
191 system administrator a way to specify the rules of rotation (such as how
192 many backup copies are kept, and what kind of compression is done).
193 When a daemon does execute
197 option, it should make sure all of the log files are closed before
200 and then it should re-open the files after
203 Usually the calling process will also want to specify the
207 will not send a signal to the very process which called it to force
209 Skipping the signal step will also mean that
211 will return faster, since
213 normally waits a few seconds after any signal that is sent.
216 If additional command line arguments are given,
218 will only examine log files that match those arguments; otherwise, it
219 will examine all files listed in the configuration file.
221 .Bl -tag -width /etc/newsyslog.confxxxx -compact
222 .It Pa /etc/newsyslog.conf
227 Previous versions of the
229 utility used the dot (``.'') character to
230 distinguish the group name.
233 this has been changed to a colon (``:'') character so that user and group
234 names may contain the dot character.
235 The dot (``.'') character is still
236 accepted for backwards compatibility.
240 utility originated from
242 and first appeared in
248 Copyright 1987, Massachusetts Institute of Technology
253 .Xr newsyslog.conf 5 ,
257 Does not yet automatically read the logs to find security breaches.