1

I have a bash script that is running on two, virtually identical servers. This script sends email essentially like this:

( commands that generate some output ) | /usr/bin/mailx -s 'Some subject line' [email protected]

This script is running on two Ubuntu 14.04 servers. The script runs successfully on both servers. By that I mean that the activities inside the (...) that perform backups, etc. complete, and I can see the results of these operations are there on both servers. However, I get the email reporting that the job has run from one of the servers but not from the other.

Background info: Both of these servers were recently upgrade from Ubuntu 12.04 and these scripts were installed on these servers as part of that upgrade. Prior to that, these same scripts were running on two other servers that were running Ubuntu 10.04, where both scripts were running and both scripts were sending me email.

One more thing about the email config - I think (would like) for this mail to be delivered through an email server on a third server that is also running Ubuntu 14.04 with postfix; however, the email headers in the message that I am receiving indicate that the message came directly from the root account on the server where the script is running (under root as a cron job).

I feel that I have missed a step setting up one of these new servers, but I cannot find it.

3
  • On the server that does not work with the script, do both (commands that generate some output ) and echo something | /usr/bin/mailx -s 'Some subject line' [email protected] work separately?
    – Wilf
    Jul 19, 2015 at 21:43
  • mailx uses a configuration file .mailx in the user's home directory. Could it be that those are different?
    – Jos
    Jul 19, 2015 at 21:43
  • Wilf - ( df ) works. echo | mailx does not. Jos - I cannot find a .mailx or a .mailrc on either of these systems. Thank you for the suggestions. I think I am going to buy a support option with Canonical and put the question to them. Will post here with any answer that I get.
    – dacDave
    Aug 15, 2015 at 13:13

0

You must log in to answer this question.

Browse other questions tagged .