p A log can be archived for two reasons: l -enum -offset indent t It is larger than the configured size (in kilobytes). t A configured number of hours have elapsed since the log was last archived. .El
p The granularity of .Nm is dependent on how often it is scheduled to run by .Xr cron 8 . It is recommended that .Nm be run once hourly.
p When starting up, .Nm reads in a configuration file to determine which logs may potentially be archived. By default, this configuration file is
a /etc/newsyslog.conf . Each line of the file contains information about a particular log file that should be handled by .Nm newsyslog . Each line has six mandatory fields and three optional fields, with whitespace separating each field. Blank lines or lines beginning with ``#'' are ignored. The fields of the configuration file are as follows:
p l -tag -width indent t Ar logfile_name Name of the system log file to be archived. t Ar owner:group This optional field specifies the owner and group for the archive file. The ":" is essential, even if the .Ar owner or .Ar group field is left blank. The field may be numeric, or a name which is present in
a /etc/group . For backward compatibility, "." is useable in lieu of ":", however use of this feature is discouraged. t Ar mode Specify the mode of the log file and archives. t Ar count Specify the number of archive files to be kept besides the log file itself. t Ar size When the size of the log file reaches .Ar size , the log file will be trimmed as described above. If this field is replaced by an asterisk
q Ql * , then the size of the log file is not taken into account when determining when to trim the log file. t Ar interval The .Ar interval field specifies the time separation (in hours) between trimming of the log file. If this field is replaced by an asterisk
q Ql * , then the interval is not taken into account when determining when to trim the log file. t Ar flags This field specifies any special processing that is required. The .Ar Z flag means that archived log files should be compressed with .Xr gzip 1 to save space. The .Ar B flag means that the file is a binary file and so the .Tn ASCII message which .Nm inserts to indicate that the logs have been trimmed should not be included. The .Ar N flag means that no signal should be sent when the log is trimmed. The .Ar C flag instructs .Nm to create an empty log file if none currently exists. The .Ar - flag means nothing - it is used as a spacer when no flags are set. t Ar path_to_pid_file This optional field specifies the file name to read to find the daemon process id. If this field is present, a signal of type .Ar sigtype is sent the process id contained in this file. This field must start with "/" in order to be recognized properly. t Ar sigtype This optional field specifies the type of signal to be sent to the daemon process. This may be a numeric or symbolic value. By default a SIGHUP (hang-up) will be sent. .El .Sh OPTIONS The following options can be used with newsyslog: l -tag -width indent t Fl f Ar config_file Instruct newsyslog to use .Ar config_file instead of
a /etc/newsyslog.conf as its configuration file. t Fl v Place .Nm in verbose mode. In this mode it will print out each log and its reasons for either trimming that log or skipping it. t Fl r Remove the restriction that .Nm must be running as root. When running as a regular user, .Nm will not be able to send a HUP signal to .Xr syslogd 8 , so this option should be used only when debugging or trimming user generated logs. t Fl F Force .Nm to trim the logs, even if the trim conditions have not been met. This option is useful for diagnosing system problems by providing you with fresh logs. .El .Sh FILES l -tag -width /etc/newsyslog.confxxxx -compact t Pa /etc/newsyslog.conf .Nm configuration file. .El .Sh AUTHORS .An Theodore Ts'o , MIT Project Athena .An Andrew Doran , The NetBSD Project
p Copyright 1987, Massachusetts Institute of Technology
p Copyright 1999, 2000 Andrew Doran .Sh SEE ALSO .Xr gzip 1 , .Xr syslog 3 , .Xr syslogd 8