由于某种原因,我的R脚本无法与crontab一起运行。我现在每分钟都有它用于测试,但是一旦工作就会更改它。
For some reason my R script will not run with a crontab. I have it for every minute right now for testing, but will change it once it works.
有什么想法吗?
* * * * * Rscript "/Users/Home/Desktop/David Studios/Scraper/compiler.R"此外,
推荐答案我可以看到可怕的智能引号。从字处理器复制粘贴时,通常会发生这种情况。在这些可憎的内容上退格并重新键入普通引号。更改:
I can see the dreaded smart quotes in your cron entry. This often happens when you copy-paste from word processors. Backspace over those abominations and re-type normal quotes. Change:
* * * * * Rscript "/Users/Home/Desktop/David Studios/Scraper/compiler.R"到
* * * * * Rscript "/Users/Home/Desktop/David Studios/Scraper/compiler.R"看到区别了吗?
我看到您已经进行了上述更改,并且仍然不能为您工作。确认拥有该crontab的用户的 $ PATH 环境变量中的 Rscript 。另外,您可以直接在cron条目中直接指定 Rscript 的完全限定路径。您可以使用以下命令在命令行上快速找到它:
I see you've made the above change and it's still not working for you. Verify that Rscript is in the $PATH environment variable for the user that owns this crontab. Alternatively, you can simply specify the fully qualified path to Rscript directly in the cron entry. You can find that quickly on the command line with the following command:
which Rscript更新#2:
我从您的评论中看到, Rscript 是 / usr / local / bin / Rscript 。我猜测 / usr / local / bin 不在拥有此crontab的用户的路径中。尝试使用完全限定的路径,例如:
Update #2:
I see by your comments that the fully qualified path to Rscript is /usr/local/bin/Rscript. I'm guessing /usr/local/bin is not in the path for the user who owns this crontab. Try using the fully qualified path, like this:
* * * * * /usr/local/bin/Rscript "/Users/Home/Desktop/David Studios/Scraper/compiler.R"更多推荐
每分钟安排一次Rscript crontab
发布评论