每分钟安排一次Rscript crontab [英] Schedule a Rscript crontab everyminute

查看:100
本文介绍了每分钟安排一次Rscript crontab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,我的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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆