I'm attempting to schedule an R script that does a scrape, some calculations and then emails a small group of people twice a day. I've gotten the script working well but I can't seem to get the crontab to work. I've given full disk access to cron, I've put the script in a folder where I've expanded the access as much as possible and I've put the execution of the R script into a shell script. Everything has as much permissions as I can give it. When I run the command in terminal it works fine but it doesn't work in cron. Can anyone help shed some light on why this isn't working?
The best I've been able to do is see R pop up in the activity monitor and then go away, so I'm assuming there's some issue with the script.
Current crontab:
0 * * * * /bin/bash /Users/billbachrach/cron_jobs/email_tests.sh
This works in terminal:
/bin/bash /Users/billbachrach/cron_jobs/email_tests.sh
Shell file:
#!/bin/sh
/usr/local/bin/Rscript /Users/billbachrach/cron_jobs/Craigslist_Good_Deal_Full_Script_V001.R
I'd share the R script but it's fairly complex. It runs on its own flawlessly and from terminal as well.
in which crontab you have entered it? Your own or the systemwide (/etc/crontab)? The system wide runs as root, as it´s entries by default run as user. therefore all entries of the script need permissions or must run with sudo. Try your crontab by using crontab -e.