Annotation of src/usr.bin/newsyslog/newsyslog.8, Revision 1.5
1.5 ! downsj 1: .\" $OpenBSD: newsyslog.8,v 1.4 1997/07/07 23:17:40 downsj Exp $
1.4 downsj 2: .\"
3: .\" Copyright (c) 1997, Jason Downs. All rights reserved.
4: .\"
5: .\" Redistribution and use in source and binary forms, with or without
6: .\" modification, are permitted provided that the following conditions
7: .\" are met:
8: .\" 1. Redistributions of source code must retain the above copyright
9: .\" notice, this list of conditions and the following disclaimer.
10: .\" 2. Redistributions in binary form must reproduce the above copyright
11: .\" notice, this list of conditions and the following disclaimer in the
12: .\" documentation and/or other materials provided with the distribution.
13: .\" 3. All advertising materials mentioning features or use of this software
14: .\" must display the following acknowledgement:
15: .\" This product includes software developed by Jason Downs for the
16: .\" OpenBSD system.
17: .\" 4. Neither the name(s) of the author(s) nor the name OpenBSD
18: .\" may be used to endorse or promote products derived from this software
19: .\" without specific prior written permission.
20: .\"
21: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
22: .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24: .\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
25: .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26: .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27: .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28: .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: .\" SUCH DAMAGE.
32: .\"
1.1 deraadt 33: .\" This file contains changes from the Open Software Foundation.
34: .\"
35: .\" from: @(#)newsyslog.8
36: .\"
37: .\" Copyright 1988, 1989 by the Massachusetts Institute of Technology
38: .\"
39: .\" Permission to use, copy, modify, and distribute this software
40: .\" and its documentation for any purpose and without fee is
41: .\" hereby granted, provided that the above copyright notice
42: .\" appear in all copies and that both that copyright notice and
43: .\" this permission notice appear in supporting documentation,
44: .\" and that the names of M.I.T. and the M.I.T. S.I.P.B. not be
45: .\" used in advertising or publicity pertaining to distribution
46: .\" of the software without specific, written prior permission.
47: .\" M.I.T. and the M.I.T. S.I.P.B. make no representations about
48: .\" the suitability of this software for any purpose. It is
49: .\" provided "as is" without express or implied warranty.
50: .\"
1.4 downsj 51: .Dd July 7, 1997
52: .Dt NEWSYSLOG 8
53: .Os OpenBSD
54: .Sh NAME
55: .Nm newsyslog
56: .Nd maintain system log files to manageable sizes
57: .Sh SYNOPSIS
58: .Nm /usr/bin/newsyslog
59: .Op Fl vmnr
60: .Op Fl f Ar configuration file
61: .Sh DESCRIPTION
62: .Nm Newsyslog
1.1 deraadt 63: is a program that should be scheduled to run periodically by
1.4 downsj 64: .Xr cron 8 .
1.1 deraadt 65: When it is executed it archives log files if necessary. If a log file
66: is determined to require archiving,
1.4 downsj 67: .Nm newsyslog
1.1 deraadt 68: rearranges the files so that ``logfile'' is empty, ``logfile.0'' has
69: the last period's logs in it, ``logfile.1'' has the next to last
70: period's logs in it, and so on, up to a user-specified number of
71: archived logs. Optionally the archived logs can be compressed to save
72: space.
1.4 downsj 73: .Pp
1.1 deraadt 74: A log can be archived because of two reasons. The log file can have
75: grown bigger than a preset size in kilobytes, or a preset number of
76: hours may have elapsed since the last log archive. The granularity of
1.4 downsj 77: .Nm newsyslog
78: is dependent on how often it is scheduled to run in
79: .Xr cron 8 .
80: Since the program is quite fast, it may be scheduled to run every hour
1.1 deraadt 81: without any ill effects.
1.4 downsj 82: .Pp
1.1 deraadt 83: When starting up,
1.4 downsj 84: .Nm newsyslog
1.1 deraadt 85: reads in a configuration file to determine which logs should be looked
86: at. By default, this configuration file is
1.4 downsj 87: .Pa /etc/newsyslog.conf .
1.1 deraadt 88: Each line of the file contains information about a particular log file
89: that should be handled by
1.4 downsj 90: .Nm newsyslog .
91: Each line has five mandatory fields and up to three optional fields, with a
1.1 deraadt 92: whitespace separating each field. Blank lines or lines beginning with
93: ``#'' are ignored. The fields of the configuration file are as
94: follows:
1.4 downsj 95: .Pp
96: .Bl -tag -width XXXXXXXXXXXXXXXX
97: .It logfile name
98: The full pathname of the system log file to be archived.
99: .It owner.group of archives (optional)
100: Specify an ownership and group for the archive file. The "." is essential,
101: even if the
102: .Ar owner
1.1 deraadt 103: or
1.4 downsj 104: .Ar group
105: field is left blank. The fields may be numeric, or a name which is looked up
106: in the system password and group databases.
107: .It mode of logfile & archives
108: Octal mode of created log files and archives.
109: .It number of archives
110: Specify he number of archives to be kept besides the log file itself.
111: .It size of archives
112: When the size of the log file reaches this point, the log file becomes trimmed
113: as described above. If this field is replaced by a ``*'', then the size of
114: the log file is not taken into account when determining when to trim the
115: log file.
116: .It archive interval
117: Specify the time separation between the trimming of the log file. If this
118: field is replaced by a ``*'', the number of hours since the last time the
119: log was trimmed will not be taken into consideration.
120: .It flags (optional)
1.1 deraadt 121: The
1.4 downsj 122: .Ar flags
1.1 deraadt 123: field specifies if the archives should have any special processing
124: done to the archived log files. The ``Z'' flag will make the archive
1.4 downsj 125: files compressed to save space using
126: .Xr gzip 1
127: or
128: .Xr compress 1 ,
129: depending on compilation options. The ``B'' flag means that the file is a
130: binary file, and so the ascii message which
131: .Nm newsyslog
1.1 deraadt 132: inserts to indicate the fact that the logs have been turned over
1.4 downsj 133: should not be included. The ``M'' flag marks this entry as a monitored
134: log file.
135: .It monitor notification (optional)
136: Specify the account that should receive notification messages if this is
1.5 ! downsj 137: a monitored log file. Notification messages are sent as email; the operator
! 138: deserves what they get if they mark the log file
! 139: .Xr sendmail 8
! 140: logs to as monitored.
1.4 downsj 141: .El
142: .Pp
143: .Sh OPTIONS
1.1 deraadt 144: The following options can be used with newsyslog:
1.4 downsj 145: .Bl -tag -width XXX
146: .It Fl f Ar config-file
1.1 deraadt 147: instructs newsyslog to use
1.4 downsj 148: .Ar config-file
1.1 deraadt 149: instead of /etc/newsyslog.conf for its configuration file.
1.4 downsj 150: .It Fl v
1.1 deraadt 151: places
1.4 downsj 152: .Nm newsyslog
1.1 deraadt 153: in verbose mode. In this mode it will print out each log and its
154: reasons for either trimming that log or skipping it.
1.4 downsj 155: .It Fl n
1.1 deraadt 156: causes
1.4 downsj 157: .Nm newsyslog
1.1 deraadt 158: not to trim the logs, but to print out what it would do if this option
159: were not specified.
1.4 downsj 160: .It Fl r
1.1 deraadt 161: removes the restriction that
1.4 downsj 162: .Nm newsyslog
1.1 deraadt 163: must be running as root. Of course,
1.4 downsj 164: .Nm newsyslog
1.1 deraadt 165: will not be able to send a HUP signal to
1.4 downsj 166: .Xr syslogd 8 ,
1.1 deraadt 167: so this option should only be used in debugging.
1.4 downsj 168: .It Fl m
169: places
170: .Nm newsyslog
171: in monitoring mode; only entries marked with an ``M'' in flags are processed,
172: and notifications sent if any have changed. Without this option, monitored
173: entries are not processed.
174: .El
175: .Pp
176: .Sh FILES
177: .Bl -tag -width /etc/newsyslog.conf
178: .It Pa /etc/newsyslog.conf
179: Default configuration file.
180: .El
181: .Sh SEE ALSO
182: .Xr gzip 1 ,
183: .Xr compress 1 ,
184: .Xr syslog 3 ,
185: .Xr syslogd 8 .
186: .Sh AUTHOR
187: .Bd -unfilled -offset indent
1.1 deraadt 188: Theodore Ts'o, MIT Project Athena
189: Copyright 1987, Massachusetts Institute of Technology
1.4 downsj 190: .Ed