newsyslog.8 (57673) | newsyslog.8 (59004) |
---|---|
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.\" $FreeBSD: head/usr.sbin/newsyslog/newsyslog.8 57673 2000-03-01 14:09:25Z sheldonh $ | 4.\" $FreeBSD: head/usr.sbin/newsyslog/newsyslog.8 59004 2000-04-04 08:50:01Z hm $ |
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 27, 1999 | 20.Dd April 4, 2000 |
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 | 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.Op Fl a Ar directory |
|
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 --- 13 unchanged lines hidden (view full) --- 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 | 31.Sh DESCRIPTION 32.Nm Newsyslog 33is a program that should be scheduled to run periodically by 34.Xr cron 8 . 35When it is executed it archives log files if necessary. If a log file 36is determined to require archiving, 37.Nm 38rearranges the files so that --- 13 unchanged lines hidden (view full) --- 52.It 53It is larger than the configured size (in kilobytes). 54.It 55A configured number of hours have elapsed since the log was last 56archived. 57.It 58This is the specific configured hour for rotation of the log. 59.El |
60.Pp |
|
59The granularity of 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 64without any ill effects, 65and mode three (above) assumes that this is so. 66.Pp 67When starting up, 68.Nm 69reads in a configuration file to determine which logs may potentially 70be archived. 71By default, this configuration file is 72.Pa /etc/newsyslog.conf . 73Each line of the file contains information about a particular log file 74that should be handled by | 61The granularity of 62.Nm 63is dependent on how often it is scheduled to run by 64.Xr cron 8 . 65Since the program is quite fast, it may be scheduled to run every hour 66without any ill effects, 67and mode three (above) assumes that this is so. 68.Pp 69When starting up, 70.Nm 71reads in a configuration file to determine which logs may potentially 72be archived. 73By default, this configuration file is 74.Pa /etc/newsyslog.conf . 75Each line of the file contains information about a particular log file 76that should be handled by |
75.Nm Ns . | 77.Nm newsyslog . |
76Each line has five mandatory fields and four 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: 80.Pp 81.Bl -tag -width indent 82.It Ar logfile_name 83Name of the system log file to be archived. --- 35 unchanged lines hidden (view full) --- 119field. 120Otherwise, the 121.Ar when 122field consists of an optional interval in hours, optionally followed 123by an 124.So Li \&@ Sc Ns No -sign 125and a time in a restricted 126.Tn ISO 8601 | 78Each line has five mandatory fields and four optional fields, with a 79whitespace separating each field. Blank lines or lines beginning with 80``#'' are ignored. The fields of the configuration file are as 81follows: 82.Pp 83.Bl -tag -width indent 84.It Ar logfile_name 85Name of the system log file to be archived. --- 35 unchanged lines hidden (view full) --- 121field. 122Otherwise, the 123.Ar when 124field consists of an optional interval in hours, optionally followed 125by an 126.So Li \&@ Sc Ns No -sign 127and a time in a restricted 128.Tn ISO 8601 |
127format. If a time is specified, the log file will only be trimmed 128if | 129format or by an 130.So Li \&$ Sc Ns No -sign 131and a time specification for logfile rotation at a fixed time once 132per day, per week or per month. 133.Pp 134If a time is specified, the log file will only be trimmed if |
129.Nm 130is run within one hour of the specified time. If an 131interval is specified, the log file will be trimmed if that many hours have 132passed since the last rotation. When both a time and an interval are 133specified, both conditions must be satisfied for the rotation to take 134place. 135.Pp | 135.Nm 136is run within one hour of the specified time. If an 137interval is specified, the log file will be trimmed if that many hours have 138passed since the last rotation. When both a time and an interval are 139specified, both conditions must be satisfied for the rotation to take 140place. 141.Pp |
136The particular format of the time is | 142There is no provision for specification of a timezone. There is 143little point in specifying an explicit minutes or seconds component in 144the current implementation, since the only comparison is `within the 145hour'. 146.Pp 147.Em ISO 8601 restricted time format 148.Pp 149The lead-in character for a restricted 150.Tn ISO 8601 151time is 152an 153.So Li \&@ Sc Ns No -sign . 154The particular format of the time in restricted 155.Tn ISO 8601 156is: |
137.Sm off 138.Oo 139.Oo 140.Oo 141.Oo 142.Oo 143.Va \&cc 144.Oc --- 40 unchanged lines hidden (view full) --- 185.It 186.Sq Li 22T 187.It 188.Sq Li \&T 189.It 190.Sq Li \& 191.El 192.Pp | 157.Sm off 158.Oo 159.Oo 160.Oo 161.Oo 162.Oo 163.Va \&cc 164.Oc --- 40 unchanged lines hidden (view full) --- 205.It 206.Sq Li 22T 207.It 208.Sq Li \&T 209.It 210.Sq Li \& 211.El 212.Pp |
193There is no provision for specification of a timezone. There is 194little point in specifying an explicit minutes or seconds component in 195the current implementation, since the only comparison is `within the 196hour'. | 213.Em Day, week and month time format 214.Pp 215The lead-in character for day, week and month specification is a 216.So Li \&$ Sc Ns No -sign . 217The particular format of day, week and month specification is: 218.Sm off 219.Oo 220.Va D\&hh 221.Oc , 222.Oo 223.Va W\&w 224.Oo 225.Va D\&hh 226.Oc 227.Oc 228and 229.Oo 230.Va M\&dd 231.Oo 232.Va D\&hh 233.Oc 234.Oc 235.Sm on 236respectively. 237Optional time fields default to midnight. 238The ranges for day and hour secifications are: 239.Pp 240.Bl -tag -width Ds -compact -offset indent 241.It Ar hh 242hours, range 0 ... 23 243.It Ar w 244day of week, range 0 ... 6, 0 = Sunday 245.It Ar dd 246day of month, range 1 ... 31, or the letter 247.Em L 248or 249.Em l 250to specify the last day of the month. 251.El 252.Pp 253Some examples: 254.Pp 255.Bl -tag -width Ds -compact -offset indent 256.It Ar $D0 257rotate every night at midnight 258.It Ar $D23 259rotate every day at 23:00 hr 260.It Ar $W0D23 261rotate every week on Sunday at 23:00 hr 262.It Ar $W5D16 263rotate every week on Friday at 16:00 hr 264.It Ar $MLD0 265rotate at the last day of every month at midnight 266.It Ar $M5D6 267rotate on every 5th day of month at 6:00 hr 268.El 269.Pp |
197.It Ar flags 198This optional field specifies if the archive should have any 199special processing done to the archived log files. 200The 201.Ar Z 202flag will make the archive files compress to save space by 203using 204.Xr gzip 1 . --- 30 unchanged lines hidden (view full) --- 235.It Fl f Ar config_file 236Instruct 237.Nm 238to use 239.Ar config_file 240instead of 241.Pa /etc/newsyslog.conf 242for its configuration file. | 270.It Ar flags 271This optional field specifies if the archive should have any 272special processing done to the archived log files. 273The 274.Ar Z 275flag will make the archive files compress to save space by 276using 277.Xr gzip 1 . --- 30 unchanged lines hidden (view full) --- 308.It Fl f Ar config_file 309Instruct 310.Nm 311to use 312.Ar config_file 313instead of 314.Pa /etc/newsyslog.conf 315for its configuration file. |
316.It Fl a Ar directory 317Specify a 318.Ar directory 319into which archived log files will be written. 320If a relative path is given, 321it is appended to the path of each log file 322and the resulting path is used as the directory 323into which the archived log for that log file will be written. 324If an absolute path is given, 325all archived logs are written into the given 326.Ar directory . 327If any component of the path 328.Ar directory 329does not exist, 330it will be created when 331.Nm 332is run. |
|
243.It Fl v 244Place 245.Nm 246in verbose mode. In this mode it will print out each log and its 247reasons for either trimming that log or skipping it. 248.It Fl n 249Cause 250.Nm --- 45 unchanged lines hidden --- | 333.It Fl v 334Place 335.Nm 336in verbose mode. In this mode it will print out each log and its 337reasons for either trimming that log or skipping it. 338.It Fl n 339Cause 340.Nm --- 45 unchanged lines hidden --- |