I want to launch a task through ssh and then exit my terminal and have my task continuing on my ssh server.
I have tried a bunch of things which did not work, such as :
laptop$ ssh server@ipaddress
server$ mytask &
[1] 12345
server$ logout
Or
laptop$ ssh server@ipaddress
server$ mytask
(then hit [Ctrl]+[Z])
server$ logout
Or even
laptop$ ssh server@ipaddress -f "mytask"
(and then close my terminal)
But even in my last attempt, closing my terminal would stop the task.
How should I proceed?
Thanks in advance!!
ssh userid@host "nohup command & "
then you an close your local terminal but task will follow its own execution on remote host – francois P Feb 17 '18 at 11:40ssh -n
), butnohup
is better. – Ned64 Feb 17 '18 at 11:41