Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 16 to 17 of 17
  1. #16
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    We weren't talking about changing scripts, just modifying it slightly so it only sends a mail on failure.

    I doubt cron changed, it's possible the script is now outputting a blank line where it wasn't before. That would result in apparently empty emails where none were generated before.

    You could change the cron line to do something like:
    Code:
    scriptname >output 2>&1 || echo ERROR $?;  grep -q . output && cat output
    This will output the string ERROR if the script exits with an error, and will only send email if there is either an error or the output file is non-empty or both. The output file must have more than just blank lines to be considered non-empty. This will only help if the reason why they're receiving an empty email is that there is a blank line in it, and you haven't shown us the email so we don't know that for sure, but it's a reasonable guess as previously no emails were being generated and now they are.

    Probably you'll need to either do some reading on this, or get some help scripting if this doesn't work.

  2. #17
    Member cpane1's Avatar
    Join Date
    Jun 2007
    Posts
    54

    Default

    Thank you so much for your response, really appreciated.... I will definitely go on to try your suggestion.

    However we ended up sorting up this issue by adding another script to do the job of emailing only when there is a error with MYSQL....

    God knows what this clients really ask for sometimes, really tough to sort out



    Quote Originally Posted by brianoz View Post
    We weren't talking about changing scripts, just modifying it slightly so it only sends a mail on failure.

    I doubt cron changed, it's possible the script is now outputting a blank line where it wasn't before. That would result in apparently empty emails where none were generated before.

    You could change the cron line to do something like:
    Code:
    scriptname >output 2>&1 || echo ERROR $?;  grep -q . output && cat output
    This will output the string ERROR if the script exits with an error, and will only send email if there is either an error or the output file is non-empty or both. The output file must have more than just blank lines to be considered non-empty. This will only help if the reason why they're receiving an empty email is that there is a blank line in it, and you haven't shown us the email so we don't know that for sure, but it's a reasonable guess as previously no emails were being generated and now they are.

    Probably you'll need to either do some reading on this, or get some help scripting if this doesn't work.
    Regards,
    cPane1®

Similar Threads & Tags
Similar threads

  1. cron output sends emails even with /dev/null 2>&1
    By Valuehosted in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-17-2010, 08:08 AM
  2. some mail /dev/null some mail not /dev/null....
    By bignose in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-15-2010, 09:37 AM
  3. Is there a way to set /dev/null to :fail:?
    By jackie46 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-29-2006, 10:57 AM
  4. /dev/null does not exist
    By Secret Agent in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-07-2005, 06:50 PM
  5. Logging to /dev/null
    By keyDet79 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-05-2003, 08:26 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube