Detach script executed after leaving ssh

xinyi85

New Member
Joined
Nov 24, 2020
Messages
3
Reaction score
0
Credits
48
Hello everyone,

I am stuck when after loging through SSH to another machine and execute a a remote script in background it get like a zombie process.

I am using: (inside EXPECT command)

spawn sh -c "/usr/bin/ssh TEST@<IP> 'cd /home/test/ ; ./SCRIPT.sh&'"

I tried several things like adding screen, nohub and so one and same story.

(also I tried

Basically I would like to login to a remote machine, go to the specific folder, execute the script in background (which has a while do loop) and exit.

after executing TOP in remote machine I can see that the SCRIPT.sh is running with an S status. But seems that does not run the part of the TFTP server which
sends a file to my local machine. Most probably is like a dead process and is doing anything.

If I execute the script manually in the remote machine it works perfect.

Any idea how to execute a remote script, exit but keeping the script running and working fine?
 

Members online


Latest posts

Top