Showing log file new lines in real time shiny web interface

shiny

#1

...I have a loooiooong Rscript processing data on server activated by uploading a csv file to shiny web inteface.
Second, or same user can't fire script again until it's finished but I need to show how things are going.
Taking into account script is writing steps to a log file....is there any way I can show logfile contents IN REAL TIME via shiny?

I know I can tail the log and show latest rows but I would like a thing like tail -f bash command, showing in real time new lines

is that possible?


#2

Yes, of course, you can do this. Use reactiveFileReader function in shiny. It will monitor a file's modification timestamp and as soon as the file is modified the webpage can reflect the contents of the file dynamically without clicking on refresh. You can write a script to reflect only the last few lines if you like.