T
T
Type Programmer2017-10-08 16:24:35
ubuntu
Type Programmer, 2017-10-08 16:24:35

Ubuntu How to run a program in the background?

Through ssh on the server I run the program, I cut down the ssh client, the program (server) is cut down

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Semenenko, 2017-10-09
@MegaCraZy6

You can use nohup, then if the ssh connection is broken, the script will continue to work
# nohup sh program_name.sh & In this case, the script output will
go to the file nohup.out
there is no longer a control terminal for it:
# ps -C sh -o pid,sid,tname,cmd
Here we will see something like:
6955 4111 ? program_name.sh
Next run:
# ps -js 4111
and you will get more information about the running process
Or study the screen command, it will launch a virtual terminal that will not fall off when you disconnect the ssh session.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question