Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schedule task on a shiny application [duplicate]

I am working on an application using shiny, as part of my project I need to scrape some data from a website on a daily basis.
Is it possible to schedule a job to be done every 12 hours, using cron or a similar utility?
I am using the free shiny server hosting server

like image 991
eliavs Avatar asked Jul 22 '14 06:07

eliavs


2 Answers

I really don't recommend doing this in shiny. Yes, invalidateLater is meant to schedule a reactive to be run again later , but your usecase is abusing that function. Also, a single shiny app session is not meant to be running 24/7, it will likely die between those 12 hours.

You should probably use a cronjob (the cronjob can call an R script, that's 100% legitimate)

like image 106
DeanAttali Avatar answered Sep 29 '22 02:09

DeanAttali


There is a specific method within Shiny doind exactly that:

invalidateLater

See also http://shiny.rstudio.com/reference/shiny/latest/invalidateLater.html.

like image 31
lambruscoAcido Avatar answered Sep 29 '22 03:09

lambruscoAcido