0

I need some assistance please.

I've written several scripts which runs on a cron schedule as root in Solaris 11.3. When I run these scripts manually I receive the mailx mails. But when the scripts are scheduled via cron under the root user I don't receive any mails.

Below the last system mail sent to root:

Final-Recipient: RFC822; [email protected]
Action: failed
Status: 5.5.0
Diagnostic-Code: SMTP; 501 5.5.4 Invalid domain name
Last-Attempt-Date: Tue, 10 May 2016 11:43:19 +0200 (SAST)

--u4A9h9nx003306.1462873399/vkbprod.
Content-Type: message/rfc822

Return-Path: <user>
Received: (from root@localhost)
        by vkbprod. (8.15.1+Sun/8.15.1) id u4A9h9nw003306
        for [email protected]; Tue, 10 May 2016 11:43:09 +0200 (SAST)
Date: Tue, 10 May 2016 11:43:09 +0200 (SAST)
From: user <user>
Message-Id: <201605100943.u4A9h9nw003306@vkbprod.>

Many thanks, Tewie

1 Answer 1

0

Please have a look at the output of your cron, as it could have error messages related to mailx (Problems with unprintable chars, UTF8 etc). Also keep in mind that in a cron job some env variables are not as they are in an interactive shell!

3
  • Hi, thanks for the response. Unfortunately the log isn't of much help.
    – TewieB
    May 12, 2016 at 6:51
  • # tail -20 /var/cron/log < sag 13022 c Thu May 12 06:15:00 2016 rc=1 > CMD: /rscripts/test-mail.bsh > root 1916 c Thu May 12 07:15:00 2016 > CMD: /app1/sag/unix_scripts/sendplog.bsh > sag 1917 c Thu May 12 07:15:00 2016 < root 1916 c Thu May 12 07:15:00 2016 rc=1 < sag 1917 c Thu May 12 07:15:00 2016 rc=1 > CMD: /rscripts/test-mail.bsh > root 9364 c Thu May 12 08:15:00 2016 > CMD: /app1/sag/unix_scripts/sendplog.bsh > sag 9366 c Thu May 12 08:15:00 2016 < root 9364 c Thu May 12 08:15:00 2016 rc=1 < sag 9366 c Thu May 12 08:15:00 2016 rc=1
    – TewieB
    May 12, 2016 at 6:53
  • It's working on another identical none productive box but for some reason I can't get it working on this one - Have a great one!
    – TewieB
    May 12, 2016 at 6:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .