Find the answer to your Linux question:
Results 1 to 2 of 2
Using CentOS. I have a cron setup to run this command: Code: /var/test.sh | mail -s "Test Cron" mr182@somewhere.com The email is sent but the output of the script is ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    33

    [SOLVED] Email output of Cron command, sends email but no content?

    Using CentOS. I have a cron setup to run this command:

    Code:
    /var/test.sh | mail -s "Test Cron" mr182@somewhere.com
    The email is sent but the output of the script is not in the email body, it's just blank. I know there is some output because there are some echo statements in the script.

    I don't want to get an email for all cronjobs, just this one.

    Any ideas?

    Thanks

  2. #2
    Just Joined!
    Join Date
    Jun 2008
    Posts
    33
    Got it working using this:

    Code:
    /var/test.sh 2>&1 | mail -v -s "Cron: test" mr182@somewhere.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...