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.
(commands that generate some output )
andecho something | /usr/bin/mailx -s 'Some subject line' [email protected]
work separately?mailx
uses a configuration file.mailx
in the user's home directory. Could it be that those are different?