Search code examples
rsshps

Using PS : cannot see my work from new terminal window


Hi I just started using ps. So, I am trying to run a R script in a cluster (after logging in using ssh) by writing

nohup R CMD BATCH a.R > a.out &

Then when I use ps -u myusername it shows :

PID TTY          TIME CMD
 4200 pts/14   00:00:00 ps
29985 ?        00:00:00 sshd
29986 pts/14   00:00:00 tcsh
32146 pts/14   00:00:00 sh
32150 pts/14   01:10:10 R

Now when I log in into ssh from new terminal window and do the same ps -u myusernameit shows

PID TTY          TIME CMD
  444 ?        00:00:00 sshd
  445 pts/1    00:00:00 tcsh
 2460 pts/1    00:00:00 ps

It doesn't show the R job I started in other terminal window. How can I see that? And even if I close the first terminal/log out from ssh, the R script should still be running, right? Because of the nohup. Sorry for so many basic question. I never used nohup and ps before, and all the details are making me feel lost.


Solution

  • Try

    top -u myusername

    If you still don't see your job, the job is not running. I personally had the same issue but somehow with the command

    nohup R --vanilla < mycode.R >& mycode.Rout&

    worked.