I have a script called cron-test.sh with a line of code to trigger an error:
#!/bin/bash
echo "Cron Tab is Running"
asdfadsf
My crontab -e has this:
* * * * * /home/user/cron-test.sh
I can't seem to get any emails of the error in my script, I know email configuration is set up properly because I tested the following in crontab -e and I get emails every minute telling me "Cron Tab is Running".
MAILTO="me@email.com"
* * * * * /home/user/cron-test.sh
How do I receive an email when an error occurs.