This article provides information about the /usr/sbin/cron[84874]: (root) CMD (newsyslog)
message and describes how to prevent the message from appearing in log files.
Clarify the meaning of the /usr/sbin/cron[84874]: (root) CMD (newsyslog) message and show how to prevent it from appearing in log files.
The newsyslog utility is scheduled to run periodically by the Unix cron command. When the command is executed, the utility archives log files, if necessary. The interval between executions can differ based on the version of the Junos OS used.
Every time newsyslog is called via the cron, it logs the following message, by default, to /var/log/messages with the Info priority:
Sep 26 19:00:00 lab-re0 /usr/sbin/cron[84847]: (root) CMD (newsyslog)
Sep 26 19:01:00 lab-re0 /usr/sbin/cron[84864]: (root) CMD (newsyslog)
Sep 26 19:02:00 lab-re0 /usr/sbin/cron[84879]: (root) CMD (newsyslog)
Sep 26 19:03:00 lab-re0 /usr/sbin/cron[84894]: (root) CMD (newsyslog)
Sep 26 19:04:00 lab-re0 /usr/sbin/cron[84909]: (root) CMD (newsyslog)
Sep 26 19:05:00 lab-re0 /usr/sbin/cron[84926]: (root) CMD (newsyslog)
Sep 26 19:06:00 lab-re0 /usr/sbin/cron[84943]: (root) CMD (newsyslog)
Sep 26 19:07:00 lab-re0 /usr/sbin/cron[84963]: (root) CMD (newsyslog)
These messages are seen only when the facility is set to
Any and the priority is set to
Info or
Any, as in this example:
system {
syslog {
file messages {
any any;
< has to be 'any' or 'info' to see these messages
}
}
}
The
/etc/crontab file below, from a node running Junos 10.4, shows that the cron will call newsyslog once every minute:
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: src/etc/crontab,v 1.32 2002/11/22 16:13:39 tom Exp $
# $Id $
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday who command
#
# Rotate log files every 1 min, if necessary.
*/1 * * * * root newsyslog < calls newsyslog every 1 minute
#
# Save some entropy so that /dev/random can re-seed on boot.
#*/11 * * * * operator /usr/libexec/save-entropy
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time. See adjkerntz(8) for details.
1,31 0-5 * * * root adjkerntz -a
#minute hour mday month wday who command
00 12 * * * root /usr/sbin/check-support -l
Intervals used in Junos OS:
- Junos 8.5 - 9.2 - every hour
- Junos 9.3 - 10.1 - every 15 minutes
- Junos 10.2 - 11.2 - every minute
- Junos 11.3 - 11.4 - by default, every 15 minutes. From 11.3 and later, the frequency of log rotation can be specified using the system syslog log-rotate-frequency command. (For more information on this command, follow this link: log-rotate-frequency.)
There are two options to prevent this message from being logged:
- Reduce the logging level to any notice:
system {
syslog {
file messages {
any notice;
}
}
}
- Or, apply a filter like this:
system {
syslog {
file messages {
any any;
match "!(\(root\) CMD \(newsyslog\))";
< note the () characters are escaped. This is required for the filter to work
}
}
}
Customers running Junos 11.3 or later can modify the frequency of logfile rotation and the occurrence of this message with the following configuration:
system {
syslog {
log-rotate-frequency <value>;
}
}