I've tried running this a few different ways, but at the moment I have my crontab file as
MAILTO=email1@gmail.com,email2@gmail.com
40 10 * * * /home/me/my_script.sh
This my_script.sh
is a shell script that runs an R script.
#!/bin/sh
/usr/bin/Rscript /home/me/stuff/daily_routine.R >> /home/me/stuff/output/outputstuff
If I just go to the terminal and run the following, though it works:
/home/me/my_script.sh
This R script downloads data from the internet. Could that be it? I've tried to include full paths everywhere, so I'm not sure that it's the PATH
variable.
I never configured anything related to email, so I'm not sure how it is supposed to send it. Maybe that's it.
Edit:
It turned out that I had never installed and configured anything to send email. I ended up fixing the issue by installing and configuring ssmtp to send emails by using my gmail account. It took me a lot of fiddling around, so I'm not sure if I have a postable solution.
Also, I am not sure whether I should delete this question or keep it up. All of the cron tutorials I found are misleading--none of them mentioned having to do this.