delete data created by app on shinyapps.io

In a shiny app hosted with shinyapps.io, I save data locally in RDS format. Can I access and delete the data outside the app?

If not, my plan is to have a "maintenance" button on the app to reset the data. From within the app, I'm able to access the data with this:

if (file.exists("data.Rds")){
  vars$data <- readRDS("data.Rds")
}

and from here delete the file content (untested, but seems feasible). But that would expose the functionality to anyone using the app. Is there instead a sequence of steps I can follow via terminal and authentification to access and delete the data? Thanks!

Shinyapps.io (unless theres been a recent change I've not been notified of / and the documentation hasnt kept pace) doesnt offer permanent storage for hosted apps. Chapter 5 Storage | shinyapps.io user guide (rstudio.com)
any RDS you save into the filesystem during your apps runtime will be deleted when the session ends.
If you need permanent storage you should look into your options to achieve that. Depending on what you go with you can no doubt clear out the data in different ways.

Thanks for your reply nirgrahamuk.

I find that the RDS I save persists over several days.

I have set it to be deleted after it reaches a certain size, otherwise it does get stored for a while (not perhaps permanently). Is there a way to delete it manually?

My app uses the logic found here: Shiny - Chat room, where the content of the chat box persists, for a while at least.

Current plan: have a button (hidden in maintenance panel, or something) with (not yet tested):

  if (file.exists("data.Rds")) {
    file.remove("data.Rds")
  }

My workaround is to redeploy the app with an empty RDS file. Seems like overkill.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.