INWTlab / rsync

R Package as interface to rsync
Other
17 stars 4 forks source link

Rshiny UI #16

Closed gadepallivs closed 12 months ago

gadepallivs commented 1 year ago

Hello, I would need to transfer files from Server X to Server Y. Currently, using Rsync bash command. However, this process is personnel dependent. Hence, would like to create an Rshiny UI, so that users can use the UI interface to execute the same command, track the progress and get an completion summary on Rshiny interface. Wondering, if this Rsync package help to integrate with Rshiny, if so any example to work with ?

aneudecker commented 1 year ago

Hi @gadepallivs,

yes, you could use the rsync package with shiny to sync your data from one server to the other. Basically all you need is the following command in the shiny backend, given that you have access to both servers from the server where you host your shiny application:

rsync::rsync(dest = "path/to/server", src = "path/to/other/server")

It will be not possible to show a progress bar or something like that as you do not know in R how far you got with syncing your files. So in shiny the reactive function would look something like this:

observeEvent(input$button, {
  rsync::rsync(dest = "path/to/server", src = "path/to/other/server")
}

You could potentially also display the output of the rsync command in your UI to show which files exist in the destination.

gadepallivs commented 1 year ago

Thank you for the reply. If the shiny browser is disconnected, will the data transfer fail? The data transfer process is quite a long step, 1hr or so. I should have mentioned, also need to pass credentials to Rsync to login on the servers. Is there any blog or an example to begin on how to run bash commands in Rshiny that you can recommend ?

aneudecker commented 1 year ago

It depends on the framework you use to host your shiny application, but technically it should work to have a long running process in a shiny application.

If your data lies in different folders you could also sync all folders separately and output the status in the shiny application. But this is more of a shiny than rsync question now 😉

wahani commented 12 months ago

I will close this issue. If there is more, please feel free to reopen.