Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
October 24, 2008, 2:19 pm
rate this thread
I'm wondering if I can use the ssh command in Ubuntu to invoke a long
running process on a remote machine and when the process has been
invoked to break the ssh connection.
I am writing a python script that needs this functionality.
What I've come up with (that doesn't work) is:
ssh -i ~/ssh/backup_key firstname.lastname@example.org "nohup python /home/user/
This allows me to ssh to the remote machine without a password, but
the ssh connection doesn't break until the "longProcess.py" is
Hopefully somebody can give me a hint here.
- Nico Kadel-Garcia
October 24, 2008, 7:04 pm
Re: Use ssh command to *invoke* long running process on remote machine.
ssh -i ~/ssh/backup_key email@example.com "nohup python \
/home/user/longProcess.py </dev/null >/dev/null 2>&1 &"
(In case your remote shell is [t]csh, use ">& /dev/null" instead of
">/dev/null 2>&1".) This is probably in a FAQ somewhere - ssh(d) is
waiting for your process to finish in case it wants to do some (I/)O
that you want to catch - if its stdin/out/err is redirected away from
the connection (actual files instead of /dev/null works fine too), there
is nothing to wait for.
- » help: putty tunneling X11 back through ssh local proxy
- — Next thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum