I am a Newbie to linux. I'm trying to figure out things. Can someone kindly help me how to combine these two commands?
(1) Normally cron can results can be directed to a log file by editing crontab in the below manner
*/10 * * * * /scripts/mysc.sh >> /home/ara/Desktop/test/log.txt 2>&1
(2) and in case we need cron results to be emails we can use MAILTO=someemail@domain.com
such as
MAILTO=someemail@domain.com
*/10 * * * * /scripts/mysc.sh
But how to combine both options (1) and (2)? I have seen some webhosting space do have both options enabled simultaneously. I did my research/googling but failed to do it. I'm using centos 6.5 and use crontab -e
to edit.