1836607 Members
2056 Online
110102 Solutions
New Discussion

Cron error message

 
ninozhou
New Member

Cron error message

Subject: cron

Redirection or piping of stdin or stdout is allowed only with -b. (156)


*********************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

/batchrun/shiprpt/shiprpt.sh
********************************************

But I can run '/batchrun/shiprpt/shiprpt.sh' manually.

Please help, Thanks!
2 REPLIES 2
Tim Nelson
Honored Contributor

Re: Cron error message

Please post your cron entry

Please post your version of HPUX

99% of the issue with cron are:

cron jobs do NOT include a standard environment, so the script working manually only says your interactive environment is OK. It does not prove that the environment while executing your script via cron is ok.

Include all needed environment vars in your script. I do not directly know nor have ever seen "Redirection or piping of stdin or stdout is allowed only with -b. (156)" so I do not know if the error is from cron itself ( don't think so ) or from some unknown command in your script.



James R. Ferguson
Acclaimed Contributor

Re: Cron error message

Hi:

Any output (STDERR or STDOUT) from a 'cron' task that isn't redirected is mailed to the initiating user account when a task is run by the 'cron' daemon.

You can do:

* * * * * /batchrun/shiprpt/shiprpt.sh > /dev/null 2>&1

...which would "bit-bucket" all STDOUT and STDERR and thus eliminate the mail you received.

The message you posted at the top "Redirection or piping of stdin or stdout is allowed only with -b" is interesting. Is this HP-UX using its 'cron' ?

Regards!

...JRF...
Regards!

...JRF...