[R-sig-Debian] running R in batch mode on Ubuntu

Elizabeth Tighe tighe at brandeis.edu
Fri Aug 16 20:50:27 CEST 2013


Dirk & Michael,

Many thanks for the swift replies! I've installed littler, but couldn't 
find documentation re: how to address issue of running in batch mode? 
Will check out screen ... We have programs that can take many hours to 
run so ability to log out and check back in later when the process is 
finished is helpful (as well as be able to connect back should ssh 
connection get interrupted).

Thanks!
Liz





On 8/16/2013 2:13 PM, Michael Rutter wrote:
>
>
> On 08/16/2013 12:50 PM, Dirk Eddelbuettel wrote:
>>
>> On 16 August 2013 at 12:45, Elizabeth Tighe wrote:
>> |
>> | So, I'm submitting R 3.0.1 jobs on Ubuntu (13.04) using 'R CMD BATCH
>> | --no-save filename.R &'  (have an alias set to subr='R CMD BATCH
>> --no-save")
>> |
>> | and am having a problem of sometimes the process ending without the R
>> | commands contained in the batch file actually having finished running.
>> |
>> | We're running Bayesian models using R2jags jags.parallel and it ends
>> | during the jags run, so it might be something funky with that package,
>> | but am curious to know if the general issue of R process ending
>> | unceremoniously is anything anyone has run into.
>>
>> Use either littler ("sudo apt-get install littler") which we wrote for
>> this purpose, or else use Rscript (which came a little later, but now
>> comes
>> with R).
>>
>> There are also packages for parsing command-line arguments, so you can
>> really
>> create scripts '#!/usr/bin/r' with all the glory.
>>
>> Dirk
>>
>
> Liz,
>
> Another alternative would be to use "screen" or one of its alternatives,
> "Byobu" or "tmux".  These are what are called terminal multiplexers.  It
> allows you to start a process, logout will killing the process, then log
> in later from the same location or different location.
>
> You can start you R script without the "&", and then detach the
> terminal.  Not exit, but detach using a specific key sequence like
> Ctrl-A d.  You can then log back in (reattach) to the terminal and see
> if it is still running or if it failed, what the output is.  If you do a
> google search for "screen tutorial linux", you will find some good
> information.  I often use this when I am running a long process on a
> server and am too lazy to write a proper script :)
>
> Michael
>



More information about the R-SIG-Debian mailing list