Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 419
kkann47 Avatar asked Feb 27 '26 02:02

kkann47


1 Answers

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.

like image 166
hd1 Avatar answered Mar 01 '26 15:03

hd1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!