Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cron logs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
wallace1819
Apprentice
Apprentice


Joined: 17 Aug 2002
Posts: 195
Location: VT

PostPosted: Thu Apr 01, 2004 4:50 pm    Post subject: cron logs Reply with quote

Is there a way to supress the large number of ...

Code:
(test -x /usr/sbin/run-crons && /usr/sbin/run-crons )


messages that apear in /var/log/messages?

I'm using vixie-cron.

wally
Back to top
View user's profile Send private message
Robostyle
n00b
n00b


Joined: 05 Jan 2004
Posts: 26
Location: The Netherlands

PostPosted: Thu Apr 01, 2004 6:15 pm    Post subject: Reply with quote

If you're using syslog-ng you could add a filter to /etc/syslog-ng/syslog-ng.conf to make the messages stop apearing:

add the lines:
Code:
filter f_cron { match("CRON"); };
filter f_cron_ignore { not filter(f_cron); };

modify the line:
Code:
log { source(src); destination(messages); };

to:
Code:
log { source(src); filter(f_cron_ignore); destination(messages); };


Don't forget to:
Code:
/etc/init.d/syslog-ng reload


It's really a cool logger, you could also log the cron message to it's own log file just in case you still want to be able to see what it has been doing.

[edit] corrected a small error


Last edited by Robostyle on Thu Apr 01, 2004 7:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
wallace1819
Apprentice
Apprentice


Joined: 17 Aug 2002
Posts: 195
Location: VT

PostPosted: Thu Apr 01, 2004 6:38 pm    Post subject: Reply with quote

thx! yea I'm using syslog-ng. I really need to find some time to learn the config file.

so this says....

Match anything containing "CRON["....
filter f_cron { match("CRON["); };

Do not log anythig that matches "f_cron"
filter f_cron_ignore { not filter(f_cron); };

log anything comming from "src" filter it through "f_cron_ignore" and write everthing else out to "messages"
log { source(src); filter(f_cron_ignore); destination(messages); };

so am i correct in assuming if i added after the above statement...
log { source(src); filter(f_cron); destination(cron.log); };

now all cron stuff will stay out of messages and in cron.log

???


thx for the help.

wally
Back to top
View user's profile Send private message
Robostyle
n00b
n00b


Joined: 05 Jan 2004
Posts: 26
Location: The Netherlands

PostPosted: Thu Apr 01, 2004 7:36 pm    Post subject: Reply with quote

Yeah, but you have to set also a destination like:
Code:
destination cron.log { file("/var/log/cron.log"); };


And remove the [ after cron in the filter, because else it expects a regular expression. My mistake, i'll edit my post to reflect the changes.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum