I am trying to open an SSH tunnel via Plink in the command line to run a few R scripts and I cannot get the R scripts to run and when they do run the tunnel was not created, so the connection to my database crashes.
The Plink code looks like this:
plink.exe -ssh [username]@[hostname] -L 3307:127.0.0.1:3306 -i "[SSH key]" -N
Followed by the code to run the R scripts
"C:\Program Files\R\R-3.2.1\bin\x64\R.exe" CMD BATCH qidash.R
I cannot seem to get the tunnel to stay open to run the R script. However, I can open the tunnel separately and run the code.