T
T
turich2011-03-20 01:18:09
SSH
turich, 2011-03-20 01:18:09

Running a script over SSH

There is a script on a remote machine that needs to be run for a long time (calculation).
Can you please tell me how to launch it in such a way that I can break the connection and at the same time the application continues to work?

ps when run with the "&" key, the script still breaks on exit.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
B
burdakovd, 2011-03-20
@turich

/usr/bin/foo >/dev/null 2>&1 &
or
nohup /usr/bin/foo >/dev/null 2>&1 &
If you need to connect later and interact with the script, then everyone recommends using screen, but I so unbearable.

M
mambet, 2011-03-20
@mambet

Try this program: en.wikipedia.org/wiki/GNU_Screen

L
Lev Lybin, 2011-03-20
@lybin

It seems to be what you need :)
unixforum.org/index.php?showtopic=111749
Learning to google!

D
Dzuba, 2011-03-20
@Dzuba

Run a cron, at worst.

V
Vladimir Kasatkin, 2014-02-19
@deQU

connect via ssh and write to the console:
1) cd "home/script1/" - write the path to the file without quotes
2) screen python "main.py" - write your file without quotes

V
Vitold S, 2011-03-20
@vit1251

nohup

A
AlexeyK, 2011-03-20
@AlexeyK

Master the screen, save a lot of time and effort.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question