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 I don't want to get an email for all cronjobs, just this one. Any ideas? Thanks |
There may be some echoes, but run it without that for now, see if you get any errors; your email there wont email anything on stderr.
|
Quote:
Code:
/var/test.sh 2>&1 && mail -v -s "Cron: test" mr182@somewhere.com |
Got it working using this:
Code:
/var/test.sh 2>&1 | mail -v -s "Cron: test" mr182@somewhere.com |
Yes, thats because there errors in the cronjob, so it redirects stderr to stdout and etc. etc.
|
All times are GMT -5. The time now is 04:34 AM. |