Martin Tomko
2010-Oct-14 16:07 UTC
[R] running a long R process on Linux using putty - best practice to disconnect
Dear all, I am sure this has been solved before, googling did not help much,. Warning, I am not great with putty/linux servers Situation: I have been given access to an R installation on a Linux server to do some larger number crunching that was killing my machine. I use putty to connect, and then go R, source("myscript") and all is fine But this will take potentially days, and I would like to disconnect What is the best practice? Someone mentionne nohup, but this would require starting the R script with an argument to R, I think. Is this doable? Another option was using screen, btu that is not available on the server. Any help is welcome. Thanks Martin
Mike Marchywka
2010-Oct-14 16:13 UTC
[R] running a long R process on Linux using putty - best practice to disconnect
----------------------------------------> Date: Thu, 14 Oct 2010 18:07:02 +0200 > From: martin.tomko at geo.uzh.ch > To: r-help at r-project.org > Subject: [R] running a long R process on Linux using putty - best practice to disconnect > > Dear all, > I am sure this has been solved before, googling did not help much,. > Warning, I am not great with putty/linux servers > > Situation: I have been given access to an R installation on a Linux > server to do some larger number crunching that was killing my machine. I > use putty to connect, and then go R, source("myscript") and all is fine > But this will take potentially days, and I would like to disconnect > > What is the best practice? Someone mentionne nohup, but this would > require starting the R script with an argument to R, I think. Is this > doable?In short, I think "R CMD BATCH script " does what you want. I routinely run R from scripts and use nohup, the two should work well together AFAIK. I have encapsulated R stuff into a script ( "myR") and have something like this , if [ "$1" == "-run" ] then echo running $2 $R CMD BATCH $2 shift ; shift fi if [ "$1" == "-go" ] then echo starting R with no params $R shift> > Another option was using screen, btu that is not available on the server. > Any help is welcome. > > Thanks > Martin > > ______________________________________________ > R-help at r-project.org 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.
Uwe Ligges
2010-Oct-14 17:21 UTC
[R] running a long R process on Linux using putty - best practice to disconnect
On 14.10.2010 18:07, Martin Tomko wrote:> Dear all, > I am sure this has been solved before, googling did not help much,. > Warning, I am not great with putty/linux servers > > Situation: I have been given access to an R installation on a Linux > server to do some larger number crunching that was killing my machine. I > use putty to connect, and then go R, source("myscript") and all is fine > But this will take potentially days, and I would like to disconnect > > What is the best practice? Someone mentionne nohup, but this would > require starting the R script with an argument to R, I think. Is this > doable?Right, just do nohup R CMD BATCH myscript.R & and make sure you save all relevant results into files within myscript.R Uwe Ligges> Another option was using screen, btu that is not available on the server. > Any help is welcome.>> Thanks > Martin > > ______________________________________________ > R-help at r-project.org 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.
Martin Tomko
2010-Oct-14 20:57 UTC
[R] running a long R process on Linux using putty - best practice to disconnect
thank you guys, R CMD BATCH seems the way to go, and I will nudge my admin to install screen /byobu Thanks heaps, Martin On 10/14/2010 7:21 PM, Uwe Ligges wrote:> > > On 14.10.2010 18:07, Martin Tomko wrote: >> Dear all, >> I am sure this has been solved before, googling did not help much,. >> Warning, I am not great with putty/linux servers >> >> Situation: I have been given access to an R installation on a Linux >> server to do some larger number crunching that was killing my machine. I >> use putty to connect, and then go R, source("myscript") and all is fine >> But this will take potentially days, and I would like to disconnect >> >> What is the best practice? Someone mentionne nohup, but this would >> require starting the R script with an argument to R, I think. Is this >> doable? > > Right, just do > > nohup R CMD BATCH myscript.R & > > and make sure you save all relevant results into files within myscript.R > > Uwe Ligges > > >> Another option was using screen, btu that is not available on the >> server. >> Any help is welcome. > > >> Thanks >> Martin >> >> ______________________________________________ >> R-help at r-project.org 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. >-- Martin Tomko Postdoctoral Research Assistant Geographic Information Systems Division Department of Geography University of Zurich - Irchel Winterthurerstr. 190 CH-8057 Zurich, Switzerland email: martin.tomko at geo.uzh.ch site: http://www.geo.uzh.ch/~mtomko mob: +41-788 629 558 tel: +41-44-6355256 fax: +41-44-6356848