0mm3
0mm3

Reputation: 419

RStudio Server on ec2 - Not persistent when closing browser tab

I am running RStudio server on an ec2 instance (using Louis Aslett's AMI) and connect through the browser.

I have some long scripts to run and thought I would be able to leave them running and close the browser tab/turn off my computer.

However, when I do this it seems to interrupt the console and when I log back into the server (pasting address into address bar and logging back in) I am met with an alert telling me that the R session terminated and my workspace is completely reset (working directory reset, and any data or variables lost).

Note that I am not terminating the instance, I am simply closing the browser tab that RStudio is loaded in.

Am I doing something wrong? Is there a proper way to disconnect safely and prevent this from happening?

Thanks

Upvotes: 4

Views: 1431

Answers (1)

Hack-R
Hack-R

Reputation: 23216

The author of the AMI implies that the AMI is based on Linux, so you can run screen before launching your RStudio server session.

The screen package is bundled with most Linux distributions. The author doesn't mention which distro his AMI is based on or list all of the included packages, but if the AMI doesn't have it, then you can use a package manger to install it:

sudo apt-get install screen -y

if your package manager is apt. The installation using the yum package manager is similar.

Upvotes: 3

Related Questions