Dear List, I am unsure if this is the correct list to post to, if it isn't I apologise. I am using SSH to access a Linux version of R on a remote computer as it offers more memory and processing power. The model will take 1-2 days to run, I am accessing R through Putty and when I close the connection and open R again, I am faced with a new session. As a Linux newbie, I was wondering if anybody here knew how to keep R running and interactive and return to it on a later date? Thanks Chris [[alternative HTML version deleted]]
On Wed, 14 Dec 2011, Chris Mcowen wrote:> As a Linux newbie, I was wondering if anybody here knew how to keep R > running and interactive and return to it on a later date?Chris, Screen will retain the session and keep the process going. Read 'man screen'. Whether this works from a remote Microsoft host I've no idea. Rich
What I did in the past (not with R scripts) is to start my jobs using at (start the job at a specified time e.g. now) or batch (start the job when the cpu drops below ?%) at now "R CMD BATCH yourscript.R" or batch "R CMD BATCH yourscript.R" something like that, you'll have to look at the man pages for at and/or batch. You probably need something like atd running. I do not know if current linux distributions have that running by default. You'll get an email when the job is finished. HTH Jan R CMD BATCH [options] my_script.R [outfile] Chris Mcowen <chrismcowen at gmail.com> schreef:> Dear List, > > > > I am unsure if this is the correct list to post to, if it isn't I apologise. > > > > I am using SSH to access a Linux version of R on a remote computer as it > offers more memory and processing power. The model will take 1-2 days to > run, I am accessing R through Putty and when I close the connection and open > R again, I am faced with a new session. > > > > As a Linux newbie, I was wondering if anybody here knew how to keep R > running and interactive and return to it on a later date? > > > > Thanks > > > > Chris > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
On Wed, Dec 14, 2011 at 4:35 AM, Chris Mcowen <chrismcowen at gmail.com> wrote:> Dear List, > > > > I am unsure if this is the correct list to post to, if it isn't I apologise. > > > > I am using SSH to access a Linux version of R on a remote computer as it > offers more memory and processing power. The model will take 1-2 days to > run, I am accessing R through Putty and when I close the connection and open > R again, I am faced with a new session. > > > > As a Linux newbie, I was wondering if anybody here knew how to keep R > running and interactive and return to it on a later date? > >I am not aware of any way to keep the R session interactive although perhaps a VNC server/client may offer this possibility. If you have a long calculation, put it all in a script named myScript.R (or any other file name) that does not require any human input, then run it as a batch using the nohup linux command: nohup R CMD BATCH myScript.R The nohup command will prevent the termination of your R after you log out, but you cannot run an interactive program this way. HTH Peter> > Thanks > > > > Chris > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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.