I want to schedule an R
script to run regularly. The most obvious attempt I found when googling is using the cronR
package and the RStudio Add-In that comes with it.
After creating a dummy script containing only cat("Hello World")
I opened the Add-In and created the job. When trying to start the job I ended up with the error message
crontab: tmp/tmp.X: Operation not permitted
This led me to the question here. I granted Terminal
and cron
full Disk access. The problem remained.
Edit after comment by @Maylo:
I tried adding the job manually using crontab -e
. The line I added was:
0 * * * * /usr/bin/Rscript /Users/me/Documents/R/test.R
After quitting crontab -e
with :wq
I got the following message on my terminal:
crontab: no crontab for me - using an empty one
crontab: installing new crontab
crontab: tmp/tmp.37904: Operation not permitted
crontab: edits left in /tmp/crontab.Jw9DPv2aBd
What else may cause this error message / problem?
Are there any other solutions to run a script regularly? (say every hour)
Thanks in advance for any help!