2010-10-01 16:32:30     cronjob terminal output

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-10-01 16:32:30     cronjob terminal output

Rob Maris (GERMANY)

Message: 94111   

 

I'm going to wonder why cronjobs do (annoying) output in the standard console, e.g.

 

Oct 1 20:23:01 crond[48]: crond: USER root pid 475 cmd /root/cron1.sh

 

Even when I add  >> /dev/null 2>&1 in crontab, it doesn't suppress it (which seems quite logical).

 

var/spool/cron/crontabs/root looks like

 

# Shell variable for cron

#SHELL=/bin/sh

# PATH variable for cron

PATH=/sbin:/usr/sbin:/bin:/usr/bin

TZ=CET-1CEST

#M S T M W Befehl

#-----------------------------------------------------------------

*/1 * * * * /root/cron1.sh >> /dev/null 2>&1

*/30 * * * * /root/cron30.sh >> /dev/null 2>&1

 

'

 

QuoteReplyEditDelete

 

 

2010-10-01 16:34:11     Re: cronjob terminal output

Mike Frysinger (UNITED STATES)

Message: 94112   

 

you're seeing the output from *crond*, not the cron jobs themselves.  configure your crond to use syslog, or not log at all.

QuoteReplyEditDelete

 

 

2010-10-01 17:05:34     Re: cronjob terminal output

Rob Maris (GERMANY)

Message: 94116   

 

yes, that's why I wrote "not logical". I haven't activated syslog in .config, I think this causes output to stdout. But I shoudn't need syslog only to get rid of this.

 

Starting crond with -l0 argument doesn't work either (yes of course, this affects only the job's output....). BTW: each time, the job start line is in stdout, some low latency processes get slightly disturbed at that very moment (e.g. I2C error, probably shift in delay of audio path (echo canceller!).

QuoteReplyEditDelete

 

 

2010-10-01 17:14:41     Re: cronjob terminal output

Mike Frysinger (UNITED STATES)

Message: 94118   

 

i never said you must use syslog.  i said that was one option.

 

dont write to the serial console if you dont want the serial overhead to perturb other devices.

QuoteReplyEditDelete

 

 

2010-10-01 17:19:21     Re: cronjob terminal output

Rob Maris (GERMANY)

Message: 94119   

 

Hm, crond -L /dev/null did it. Quite not logical - I'd expect a meta suppress option, or anything like

 

echo "4 1 1 7" > /proc/sys/kernel/printk # suppress some printk outputs

 

which I have impremented recently in rc prior to probing gpio-keys to get rid of these ugly warn output for every GPIO pin that iss assigned an input in the board file.

 

.

QuoteReplyEditDelete

 

 

2010-10-01 17:20:53     Re: cronjob terminal output

Rob Maris (GERMANY)

Message: 94120   

 

Oh, eh your post crossed - however thanks for helping the proper direction for getting it right now.

QuoteReplyEditDelete

 

 

2010-10-01 17:26:18     Re: cronjob terminal output

Mike Frysinger (UNITED STATES)

Message: 94121   

 

the documentation explains how to control the printk output to the console:

  docs.blackfin.uclinux.org/doku.php?id=silent_booting

 

although, writing to the printk procfs file also allows of filtering of all messages and not just the console ones.

QuoteReplyEditDelete

 

 

2010-10-01 17:45:51     Re: cronjob terminal output, side topic bfin_gpio

Rob Maris (GERMANY)

Message: 94122   

 

Mike, thanks for the information pointer. Note: before I found the procfs opportunity in the depths of the internet, I patched bfin_gpio in order to reduce the message length to under 80 characters. Patch attached. It's up to you whether it is transferred to trunk or not..

 

patch

QuoteReplyEditDelete

 

 

2010-10-01 17:54:19     Re: cronjob terminal output, side topic bfin_gpio

Mike Frysinger (UNITED STATES)

Message: 94123   

 

i think i'll get more questions from people who cant find the file

Attachments

Outcomes