This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: how to stop cron logging into NT eventlog ?
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Wed, 02 Mar 2005 14:32:52 -0800
- Subject: Re: how to stop cron logging into NT eventlog ?
- Organization: My own little world...
- References: <422637DF.5050101@free.fr>
- Reply-to: cygwin at cygwin dot com
kagemaru wrote:
> I would like to refer to this thread :
> http://sourceware.org/ml/cygwin/2004-10/msg01322.html
>
> I have tried many options, like -1 and -2 options as advised but cron
> still logs into the NT eventlog. It is the same on NT4, XP, W2K and W2K3.
>
> I have registered the service as :
>
> cygrunsrv -I "cygwin cron" -p /usr/sbin/cron -a -D -1 /var/log/cron.log -2 /var/log/cron.log
>
> Do you have a solution to avoid cron log in to eventlog ?
cron calls syslog() directly to emit its messages, it doesn't use the
facility of cygrunsrv that can redirect stdout and stderr to the
syslog. Thus you won't be able to prevent it from logging in that
manner.
You can try placing a '-' character at the beginning of each crontab
entry to prevent logging that action. See "man 5 crontab".
If that does not work you'll need to compile cron to not use
syslogging. I think you can do this by simply un-defining SYSLOG in
config.h, in which case it will log to a file, /var/cron/log by default
I think.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/