Re: [R] Start and Restart R over SSH
On Mon, 19 Feb 2007, Benilton Carvalho wrote: > Hi Nils, > > if the server you're using is *NIX, this is what you can do: > > example > ssh [EMAIL PROTECTED] > screen > R > > << do what you need in R>> > << close the terminal without quitting R >> > > ssh [EMAIL PROTECTED] > screen -r > << continue working in R >> > %% end example > > the "problem" is if you need X... it works until you quit the > terminal, but "screen -r" doesn't reconnect the X11. I find vnc sometimes helps with keeping a X active for an R session. Also, if you take care to close your x11 devices, and if when you re-ssh you happen to get the same forwarded X DISPLAY=localhost:11.0 or whatever, the R session in screen will use the new forwarded connection. It also seems like using Sys.putenv(DISPLAY='localhost:11.0') overrides the DISPLAY that screen's child R session inherits from the initial invocation of screen. Dave -- Dr. David Forrest [EMAIL PROTECTED](804)684-7900w [EMAIL PROTECTED] (804)642-0662h http://maplepark.com/~drf5n/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Start and Restart R over SSH
Nils Höller wrote: > Hi, > > I have some big calculations in R to be done. > Since I can use R on a server with ssh, i was wondering if I can reopen > a R Shell after exiting ssh. > > I don't want to use the batch mode and nohup doesn't work. > > I want to use something like > ssh [EMAIL PROTECTED] > R > ---do something in R and start calculation --- > close ssh but let R remain on the server, doing the calculation > > ssh [EMAIL PROTECTED] > open the existing R Shell / Process > > Has anyone done something similiar? > Can you help me or suggest an other solution ? > Use "screen" http://www.gnu.org/software/screen/ 1. Login to remote server 2. Run screen 3. Run R, and the long calculation 4. Detach screen (Ctrl-A, Ctrl-D) 5. Logout Then you may login to server again, re-attach to the running screen and carry on! Best wishes, Mark -- Specialist Registrar and Clinical research fellow Department of Neurology Cardiff & Vale NHS Trust and Cardiff University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Start and Restart R over SSH
Hi, You can take a look at GNU screen programm: http://www.gnu.org/software/screen/ Andris Jankevics On Pirmdiena, 19. Februāris 2007 15:56, Nils Höller wrote: > Hi, > > I have some big calculations in R to be done. > Since I can use R on a server with ssh, i was wondering if I can reopen > a R Shell after exiting ssh. > > I don't want to use the batch mode and nohup doesn't work. > > I want to use something like > ssh [EMAIL PROTECTED] > R > ---do something in R and start calculation --- > close ssh but let R remain on the server, doing the calculation > > ssh [EMAIL PROTECTED] > open the existing R Shell / Process > > Has anyone done something similiar? > Can you help me or suggest an other solution ? > > Thank you for your help > > Nils > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html and provide commented, minimal, > self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Start and Restart R over SSH
Hi Nils, if the server you're using is *NIX, this is what you can do: example ssh [EMAIL PROTECTED] screen R << do what you need in R>> << close the terminal without quitting R >> ssh [EMAIL PROTECTED] screen -r << continue working in R >> %% end example the "problem" is if you need X... it works until you quit the terminal, but "screen -r" doesn't reconnect the X11. b On Feb 19, 2007, at 9:40 AM, Douglas Bates wrote: > On 2/19/07, Nils Höller <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have some big calculations in R to be done. >> Since I can use R on a server with ssh, i was wondering if I can >> reopen >> a R Shell after exiting ssh. >> >> I don't want to use the batch mode and nohup doesn't work. >> >> I want to use something like >> ssh [EMAIL PROTECTED] >> R >> ---do something in R and start calculation --- >> close ssh but let R remain on the server, doing the calculation >> >> ssh [EMAIL PROTECTED] >> open the existing R Shell / Process >> >> Has anyone done something similiar? >> Can you help me or suggest an other solution ? > > I don't think it is possible to reattach to a process started in one > ssh session from another ssh session. However, you can put a session > into the background with the -f flag to ssh. You haven't told us what > operating system you are starting the ssh connection on and what > system will run the R process. If I had an X server running on the > local system and the remote system provided X clients like xterm I > would do this by > > ssh -X -f [EMAIL PROTECTED] xterm > > This should spring up an autonomous xterm window on the local machine > after which you can run R in it. > > I hope this helps. > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Start and Restart R over SSH
Douglas Bates wrote: > On 2/19/07, Nils Höller <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I have some big calculations in R to be done. >> Since I can use R on a server with ssh, i was wondering if I can reopen >> a R Shell after exiting ssh. >> >> I don't want to use the batch mode and nohup doesn't work. >> >> I want to use something like >> ssh [EMAIL PROTECTED] >> R >> ---do something in R and start calculation --- >> close ssh but let R remain on the server, doing the calculation >> >> ssh [EMAIL PROTECTED] >> open the existing R Shell / Process >> >> Has anyone done something similiar? >> Can you help me or suggest an other solution ? > > I don't think it is possible to reattach to a process started in one > ssh session from another ssh session. However, you can put a session No, it is. Check out the screen command - it is backgrounding your session, you can have several running at the same time and reattach and they persist between logouts (obviously, if you switch the computer of, it is gone...) Rainer > into the background with the -f flag to ssh. You haven't told us what > operating system you are starting the ssh connection on and what > system will run the R process. If I had an X server running on the > local system and the remote system provided X clients like xterm I > would do this by > > ssh -X -f [EMAIL PROTECTED] xterm > > This should spring up an autonomous xterm window on the local machine > after which you can run R in it. > > I hope this helps. > > __ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa Tel:+27 - (0)72 808 2975 (w) Fax:+27 - (0)86 516 2782 Fax:+27 - (0)21 808 3304 (w) Cell: +27 - (0)83 9479 042 email: [EMAIL PROTECTED] [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Start and Restart R over SSH
On 2/19/07, Nils Höller <[EMAIL PROTECTED]> wrote: > Hi, > > I have some big calculations in R to be done. > Since I can use R on a server with ssh, i was wondering if I can reopen > a R Shell after exiting ssh. > > I don't want to use the batch mode and nohup doesn't work. > > I want to use something like > ssh [EMAIL PROTECTED] > R > ---do something in R and start calculation --- > close ssh but let R remain on the server, doing the calculation > > ssh [EMAIL PROTECTED] > open the existing R Shell / Process > > Has anyone done something similiar? > Can you help me or suggest an other solution ? I don't think it is possible to reattach to a process started in one ssh session from another ssh session. However, you can put a session into the background with the -f flag to ssh. You haven't told us what operating system you are starting the ssh connection on and what system will run the R process. If I had an X server running on the local system and the remote system provided X clients like xterm I would do this by ssh -X -f [EMAIL PROTECTED] xterm This should spring up an autonomous xterm window on the local machine after which you can run R in it. I hope this helps. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Start and Restart R over SSH
Hi, I have some big calculations in R to be done. Since I can use R on a server with ssh, i was wondering if I can reopen a R Shell after exiting ssh. I don't want to use the batch mode and nohup doesn't work. I want to use something like ssh [EMAIL PROTECTED] R ---do something in R and start calculation --- close ssh but let R remain on the server, doing the calculation ssh [EMAIL PROTECTED] open the existing R Shell / Process Has anyone done something similiar? Can you help me or suggest an other solution ? Thank you for your help Nils __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.