I’m looking for a (simple) way to run r script when restarting shiny-server.
I need to re-create / consolidate databases into R that will be used/queried in my shiny application.
The problem is that such operations take a long time (probably > 5 minutes), and thus, can not be run too often.
My understanding of global.R is that this script is executed the first time the application is launched after a fresh restart of shiny-server.
In my case, I’d like to find a way to launch such a script when restarting the server, not waiting for a user to connect to the app.
So, some sort of a globaller.R script.
Any idea how to make this without having to rely on crontab or any scheduled way ?
My workflow is that I have a DB built from numerous (and heavy) CSV files. But this DB can sometimes get corrupted, and then, I have to build it again. Considering the DB (MonetDBLite) relies on the shiny-server (need to restart it so that the DB is available again after creating it), it would be quite efficient to have the restart trigger a script, so that I don’t have to run anything manually after restarting shiny-server or rebooting the server.
Thanks for any help