每分钟安排一次Rscript crontab

编程入门 行业动态 更新时间:2024-10-26 00:22:14
本文介绍了每分钟安排一次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

本文发布于:2023-06-07 15:29:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/568635.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:每分钟   Rscript   crontab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!