newsyslog.8 (36817) | newsyslog.8 (43071) |
---|---|
1.\" This file contains changes from the Open Software Foundation. 2.\" 3.\" from: @(#)newsyslog.8 | 1.\" This file contains changes from the Open Software Foundation. 2.\" 3.\" from: @(#)newsyslog.8 |
4.\" $Id: newsyslog.8,v 1.13 1998/05/10 19:04:05 hoek Exp $ | 4.\" $Id: newsyslog.8,v 1.14 1998/06/09 18:24:04 ache Exp $ |
5.\" 6.\" Copyright 1988, 1989 by the Massachusetts Institute of Technology 7.\" 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. 19.\" | 5.\" 6.\" Copyright 1988, 1989 by the Massachusetts Institute of Technology 7.\" 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. 19.\" |
20.Dd January 12, 1989 | 20.Dd January 22, 1999 |
21.Dt NEWSYSLOG 8 22.Os 23.Sh NAME 24.Nm newsyslog 25.Nd maintain system log files to manageable sizes 26.Sh SYNOPSIS 27.Nm newsyslog 28.Op Fl Fnrv 29.Op Fl f Ar config_file 30.Sh DESCRIPTION 31.Nm Newsyslog 32is a program that should be scheduled to run periodically by 33.Xr cron 8 . 34When it is executed it archives log files if necessary. If a log file 35is determined to require archiving, 36.Nm | 21.Dt NEWSYSLOG 8 22.Os 23.Sh NAME 24.Nm newsyslog 25.Nd maintain system log files to manageable sizes 26.Sh SYNOPSIS 27.Nm newsyslog 28.Op Fl Fnrv 29.Op Fl f Ar config_file 30.Sh DESCRIPTION 31.Nm Newsyslog 32is a program that should be scheduled to run periodically by 33.Xr cron 8 . 34When it is executed it archives log files if necessary. If a log file 35is determined to require archiving, 36.Nm |
37rearranges the files so that ``logfile'' is empty, ``logfile.0'' has 38the last period's logs in it, ``logfile.1'' has the next to last | 37rearranges the files so that 38.Dq Va logfile 39is empty, 40.Dq Va logfile Ns Li \&.0 41has 42the last period's logs in it, 43.Dq Va logfile Ns Li \&.1 44has the next to last |
39period's logs in it, and so on, up to a user-specified number of 40archived logs. Optionally the archived logs can be compressed to save 41space. 42.Pp | 45period's logs in it, and so on, up to a user-specified number of 46archived logs. Optionally the archived logs can be compressed to save 47space. 48.Pp |
43A log can be archived because of two reasons. The log file can have 44grown bigger than a preset size in kilobytes, or a preset number of 45hours may have elapsed since the last log archive. The granularity of | 49A log can be archived for three reasons: 50.Bl -enum -offset indent 51.It 52It is larger than the configured size (in kilobytes). 53.It 54A configured number of hours have elapsed since the log was last 55archived. 56.It 57This is the specific configured hour for rotation of the log. 58.El 59The granularity of |
46.Nm 47is dependent on how often it is scheduled to run by 48.Xr cron 8 . 49Since the program is quite fast, it may be scheduled to run every hour | 60.Nm 61is dependent on how often it is scheduled to run by 62.Xr cron 8 . 63Since the program is quite fast, it may be scheduled to run every hour |
50without any ill effects. | 64without any ill effects, 65and mode three (above) assumes that this is so. |
51.Pp 52When starting up, 53.Nm | 66.Pp 67When starting up, 68.Nm |
54reads in a configuration file to determine which logs should be looked 55at. By default, this configuration file is | 69reads in a configuration file to determine which logs may potentially 70be archived. 71By default, this configuration file is |
56.Pa /etc/newsyslog.conf . 57Each line of the file contains information about a particular log file 58that should be handled by 59.Nm newsyslog . 60Each line has five mandatory fields and three optional fields, with a 61whitespace separating each field. Blank lines or lines beginning with 62``#'' are ignored. The fields of the configuration file are as 63follows: --- 16 unchanged lines hidden (view full) --- 80Specify the mode of the log file and archives. 81.It Ar count 82Specify the number of archive files to be kept 83besides the log file itself. 84.It Ar size 85When the size of the log file reaches 86.Ar size , 87the log file will be trimmed as described above. If this field | 72.Pa /etc/newsyslog.conf . 73Each line of the file contains information about a particular log file 74that should be handled by 75.Nm newsyslog . 76Each line has five mandatory fields and three optional fields, with a 77whitespace separating each field. Blank lines or lines beginning with 78``#'' are ignored. The fields of the configuration file are as 79follows: --- 16 unchanged lines hidden (view full) --- 96Specify the mode of the log file and archives. 97.It Ar count 98Specify the number of archive files to be kept 99besides the log file itself. 100.It Ar size 101When the size of the log file reaches 102.Ar size , 103the log file will be trimmed as described above. If this field |
88is replaced by a 89.Ar * , | 104is replaced by an asterisk 105.Pq Ql \&* , |
90then the size of the log file is not taken into account 91when determining when to trim the log file. | 106then the size of the log file is not taken into account 107when determining when to trim the log file. |
92.It Ar interval 93When 94.Ar interval 95hours have passed, the log file will be trimmed. If this field is 96replaced by a 97.Ar * , 98then the number of hours since the last time the log was 99trimmed will not be taken into consideration. | 108.It Ar when 109The 110.Ar when 111field can consist of an interval, a specific time, or both. If 112the 113.Ar when 114field is an asterisk 115.Pq Ql \&* 116log rotation will depend only on the contents of the 117.Ar size 118field. 119Otherwise, the 120.Ar when 121field consists of an optional interval in hours, optionally followed 122by an 123.So Li \&@ Sc Ns No -sign 124and a time in a restricted 125.Tn ISO 8601 126format. If a time is specified, the log file will only be trimmed 127if 128.Nm newsyslog 129is run within one hour of the specified time. If an 130interval is specified, the log file will be trimmed if that many hours have 131passed since the last rotation. When both a time and an interval are 132specified, both conditions must be satisfied for the rotation to take 133place. 134.Pp 135The particular format of the time is 136.Sm off 137.Oo 138.Oo 139.Oo 140.Oo 141.Oo 142.Va \&cc 143.Oc 144.Va \&yy 145.Oc 146.Va \&mm 147.Oc 148.Va \&dd 149.Oc 150.Oo 151.Li \&T 152.Oo 153.Va \&hh 154.Oo 155.Va \&mm 156.Oo 157.Va \&ss 158.Oc 159.Oc 160.Oc 161.Oc 162.Oc . 163.Sm on 164Optional date fields default to the appropriate component of the 165current date; optional time fields default to midnight; hence if today 166is January 22, 1999, the following date specifications are all 167equivalent: 168.Pp 169.Bl -item -compact -offset indent 170.It 171.Sq Li 19990122T000000 172.It 173.Sq Li 990122T000000 174.It 175.Sq Li 0122T000000 176.It 177.Sq Li 22T000000 178.It 179.Sq Li T000000 180.It 181.Sq Li T0000 182.It 183.Sq Li T00 184.It 185.Sq Li 22T 186.It 187.Sq Li \&T 188.It 189.Sq Li \& 190.El 191.Pp 192There is no provision for specification of a timezone. There is 193little point in specifying an explicit minutes or seconds component in 194the current implementation, since the only comparison is `within the 195hour'. |
100.It Ar flags 101This optional field specifies if the archive should have any 102special processing done to the archived log files. 103The 104.Ar Z 105flag will make the archive files compress to save space by 106using 107.Xr gzip 1 . --- 76 unchanged lines hidden --- | 196.It Ar flags 197This optional field specifies if the archive should have any 198special processing done to the archived log files. 199The 200.Ar Z 201flag will make the archive files compress to save space by 202using 203.Xr gzip 1 . --- 76 unchanged lines hidden --- |