1 .\" This file contains changes from the Open Software Foundation.
3 .\" from: @(#)newsyslog.8
4 .\" $FreeBSD: src/usr.sbin/newsyslog/newsyslog.8,v 1.51 2005/06/14 12:26:35 ru Exp $
5 .\" $DragonFly: src/usr.sbin/newsyslog/newsyslog.8,v 1.4 2007/05/12 08:52:00 swildner Exp $
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.
26 .Nd maintain system log files to manageable sizes
33 .Op Fl f Ar config_file
38 utility should be scheduled to run periodically by
40 When it is executed it archives log files if necessary.
41 If a log file 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 space.
55 A log can be archived for three reasons:
56 .Bl -enum -offset indent
58 It is larger than the configured size (in kilobytes).
60 A configured number of hours have elapsed since the log was last
63 This is the specific configured hour for rotation of the log.
68 is dependent on how often it is scheduled to run by
70 Since the program is quite fast, it may be scheduled to run every hour
71 without any ill effects,
72 and mode three (above) assumes that this is so.
74 The following options can be used with
76 .Bl -tag -width indent
77 .It Fl f Ar config_file
83 .Pa /etc/newsyslog.conf
84 for its configuration file.
88 into which archived log files will be written.
89 If a relative path is given,
90 it is appended to the path of each log file
91 and the resulting path is used as the directory
92 into which the archived log for that log file will be written.
93 If an absolute path is given,
94 all archived logs are written into the given
96 If any component of the path
99 it will be created when
102 .It Fl d Ar directory
105 which all log files will be relative to.
106 To allow archiving of logs outside the root, the
110 option is unaffected.
115 In this mode it will print out each log and its
116 reasons for either trimming that log or skipping it.
120 not to trim the logs, but to print out what it would do if this option
123 Remove the restriction that
125 must be running as root.
128 will not be able to send a HUP signal to
130 so this option should only be used in debugging.
134 should not send any signals to any daemon processes that it would
135 normally signal when rotating a log file.
136 For any log file which is rotated, this option will usually also
137 mean the rotated log file will not be compressed if there is a
138 daemon which would have been signalled without this option.
139 However, this option is most likely to be useful when specified
142 option, and in that case the compression will be done.
144 If specified once, then
146 will create any log files which do not exist, and which have the
148 flag specified in their config file entry.
149 If specified multiple times, then
151 will create all log files which do not already exist.
152 If log files are given on the command-line, then the
156 will only apply to those specific log files.
160 to trim the logs, even if the trim conditions have not been met.
161 This option is useful for diagnosing system problems by providing you with
162 fresh logs that contain only the problems.
164 Do not perform any rotations.
165 This option is intended to be used with the
169 options when creating log files is the only objective.
173 should rotate a given list of files, even if trim conditions are not
177 is only used in the messages written to the log files which are
179 This differs from the
181 option in that one or more log files must also be specified, so that
183 will only operate on those specific files.
184 This option is mainly intended for the daemons or programs which write
185 some log files, and want to trigger a rotate based on their own criteria.
186 With this option they can execute
188 to trigger the rotate when they want it to happen, and still give the
189 system administrator a way to specify the rules of rotation (such as how
190 many backup copies are kept, and what kind of compression is done).
191 When a daemon does execute
195 option, it should make sure all of the log files are closed before
198 and then it should re-open the files after
201 Usually the calling process will also want to specify the
205 will not send a signal to the very process which called it to force
207 Skipping the signal step will also mean that
209 will return faster, since
211 normally waits a few seconds after any signal that is sent.
214 If additional command line arguments are given,
216 will only examine log files that match those arguments; otherwise, it
217 will examine all files listed in the configuration file.
219 .Bl -tag -width /etc/newsyslog.confxxxx -compact
220 .It Pa /etc/newsyslog.conf
225 Previous versions of the
227 utility used the dot (``.'') character to
228 distinguish the group name.
231 this has been changed to a colon (``:'') character so that user and group
232 names may contain the dot character.
233 The dot (``.'') character is still accepted for backwards compatibility.
238 .Xr newsyslog.conf 5 ,
244 utility originated from
246 and first appeared in
252 Copyright 1987, Massachusetts Institute of Technology
254 Does not yet automatically read the logs to find security breaches.