I am installing new crontab job which will execute a shell script and then send the printed errors on the console to email. I know all of the required steps to do, which will be as following:
0 10,22 * * * . /X.sh 2>&1 >/dev/null | mail -s "subject" "email"
Mu question is: when will it send the email?
- it will send an email each 12 hours even if shell script finished before the next round (I mean the next new cron job).
- it will send an email after finish executing from shell script even the duration of the current cron is still active.