Entering edit mode
4.9 years ago
szp770
▴
10
Hi, all. Now I have an R script and bam files in my linux system. I want to know how to run this R script with nohup. Thanks!
Please don't. Use
screenortmux.Use
Rscriptnot theRbinary. As Wouter said,tmuxandscreenare better choices, but have a bit more of a learning curve.Otherwise, using
nohupwithRscriptis the same as for any other binary:(or whatever the execution for your script looks like).
How does
screenhave a learning curve? You open a new screen byscreen -S <screenname>, leave it by pressingCtrlAthenCtrlD, and return to the screen by typingscreen -r <screenname>. Agreed that this is far better thannohup. @OP, can you elaborate on which system you are, so a cluster, AWS, personal laptop etc? Is running RStudio an option for a GUI?The learning curve is that you need to get used to the idea that its a 'separate' terminal session, this has implications for preserving the
history, the scrollback buffer, process ownership, the fact thatCtrl-Ano longer moves the cursor to the start of the line, and for attaching and detatching sessions (as well as how to figure out what session is what etc. The list goes on...There's no doubt in my mind it has extra hurdles than
nohup, but I'm not disputing that its worthwhile! :)I see your point, probably I simply got too used of using
screenfor years that I forgot about the little details.