简体   繁体   中英

Scheduling R Script - OSX

I have written a series of R Scripts that create csv files. From there, Tableau will read the csv's and update various dashboards. As Tableau can easily be scheduled to update on a daily cadence, I was hoping to do the same with my R Script.

While there are a bunch of answers already with solutions for Windows, there hasn't been a solution posted for OSX. I have looked into trying to run my script in Terminal and use automator to do it, but couldn't quite figure it out. Basically, when the shell script runs it terminates midway through because there are errors in the R Script - but I do not care about the errors. The Automator didn't work as well.

Additionally, I also looked into Data Integration/Pentaho but the additional software configuration and subsequent installation seemed difficult.

Any help or insight would be greatly appreciated! Thanks!

Type crontab -e and add this line to the resulting file

@daily Rscript 1.R && Rscript 2.R 

It will run the files 1.R, followed by 2.R at midnight every day. Hope that helps.

最灵活的方法是使用launchd ,即管理OS X上的进程的服务。您可以查看官方文档中的一些示例。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM