I am using a windows machine as a ssh server. I want to remotely run some tasks which takes several hours to finish. Is there any way to have persistent process even after remote ssh session is disconnected in Powershell?
Answer
After some experimentation, now I have replaced ssh with PowerShell Remoting.
Especially, START A REMOTE JOB THAT KEEPS THE RESULTS ON THE REMOTE COMPUTER section of the about_Remote_Jobs has been really helpful.
Basically, my current workflow is
- Open a new PSSession
- Invoke a command (
Invoke-Command
) on the remote server as a job, withStart-Job
Then I can freely Disconnect from the session and later reconnect to the session and get the job outputs with Receive-Job
.
No comments:
Post a Comment