[Cron jobs] More error reporting...
Hi,
Right now, the vanilla setup of crontab, prevents us to receive failure mail. Because: - contrab is redirecting stdout to /dev/null - run-parts is always emitting something and redirect stderr script channel into the stdout channel (so it goes into garbage). We were able to fix all this with: 1) fixing /usr/bin/run-parts (see below). 2) removing the "1> /dev/null" from the cron tab. run-parts original code: Code:
# If we've made it this far, then run the script if it's executable: Code:
# If we've made it this far, then run the script if it's executable: Code:
$SCRIPT || echo "$SCRIPT failed." 1>&2 Everything run smoothly, the only mail we have are "errors". Note that we CAN receive mail if something outputs to stdout, but usually a good unix tool, run silently if no error, and if it verbose something, its better(/easy) just to redirect THAT call and not everything... Of course part of the comment on top of crontab might be deprecated if those fix are applied :). Obviously, cron jobs scripts should have a normal behavior (we had to fix logrotate too, see this thread)... Cheers Garry. |
Just to quote the comment on top of the cron tab:
Code:
# If you don't want the output of a cron job mailed to you, you have to direct That's all... Sorry, we're in delivery time here, it's hot, and didn't had the time (/mind) to pack all those in one post. :) Cheers Garry. |
Sorry to bump this, but is it irrelevant ? Do I need to provide more information ? Does it introduce a risk of breaking something ? Anything ? :)
Cheers Garry. |
and I thought it was just "me"...
The only 2 mails I have ever received are Code:
sudo mail -u root Code:
35 # If we've made it this far, then run the script if it's executable: Subscribed with Interest... JJ |
Quote:
I might have chosen the title badly tho. Hey Habitual, you have quite an interesting blog, a great snippet vault! Cheers Garry. |
Quote:
Peace. P.S. Tomorrow, I have another cron set to run at 8am EDT, so I'm hoping... Any clues in the cron log(s)? |
Quote:
I just wish it could be integrated in stock slackware, as for my point of view it's a real fix of a real "bug"... (and it's more in the 'vanilla' philosophy of slackware than the existing code IMHO). |
All times are GMT -5. The time now is 05:23 PM. |