title: Submitting R jobs via single ssh command using nohup bash -c
body: <p>I used to work with an older university server where I could submit analysis jobs using commands like the following. The server was a bit dated and using C Shell.</p>
  <pre><code>ssh -t user@oldserver 'cd ~/hte_paper/Code; nohup tcsh -c &quot;R CMD BATCH analysis-file1.r; R CMD BATCH analysis-file2.r&quot; &amp;'
  </code></pre>
  <p>With the Ubuntu 20.04 server images provided by the Uni I work at now, this doesn't work anymore. Neither of the following commands work, nor do any of the variations I've tried. What am I missing? I've been using these commands in Makefiles to automate some work and prefer that over using tmux.</p>
  <pre><code>ssh -t user@myserver 'cd ~/some/folder; nohup bash -c &quot;R CMD BATCH analysis-file.r&quot; &amp;' 
  ssh -t user@myserver 'nohup bash -c &quot;cd ~/some/folder; R CMD BATCH analysis-file.r&quot; &amp;' 
  </code></pre>