Update shinyapp on Shinyserver

Hello there,
I have a shinyapp on shinyserver that sends an email.
I would like to schedule this app.

This app work properly if I lunch it from URL
but not working if I try to call it server side.

I try with chromium & puppeteer, firfox, Phantomjs and bash like this

#!/usr/bin/Rscript
Rscript -e "shiny::runApp('nameApp')"

But not send email.
I suppose that's because Js not start properly, if not client server.

Any idea?
Thanks a lot in advance!

Hi @Marghe, do you need to interact with the Shiny app to trigger the email? Is that why you're using chromium (to automate this interaction)? It'd be helpful to know more about what you tried and why it's failing

1 Like

Thanks @cpsievert for your interest.

I have an app like this

UI <-
a graphic and a downloadButton for download an excel

SERVER <-
if today is monday
then call a DB, make an excel and send a mail (with excel in attach if it is small)

At the end, my users receive an email with the attachment
and the url of the app, where they can see other information.

I'd like schedule this process server side,
so I won't have to remember every Monday to click on the url to start the process.

What is the right way to do this?
Thanks a lot in advance!

The first thing I'd try is to decouple the emailing logic from the Shiny app, ideally as an R function that you can call outside of the Shiny.

Then you could use a simple cron job (or similar) to schedule that R function to run on some recurring schedule.

3 Likes

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.