Answer the question
In order to leave comments, you need to log in
How to run python script on CentOS?
Tell me please.
Here is a Python script. It is necessary that it be launched on the server and work around the clock using server resources.
Linux server uses centos. There is a cpanel control panel and ssh root access. There are options to run through the crontab every year, every minute.
And you need to run it with the command once and until it ends or an error occurs.
If anyone knows, tell me more, is it possible to view running processes and the number of threads on such a server?
Answer the question
In order to leave comments, you need to log in
Ssh in and run in the background with nohup (read what it is)
, you can use screen or tmux, but these are screen managers that also know how to nohup, so pure nohup is more lightweight.
The simplest option:
If the script itself does not know how to behave as a daemon, then it is possible through cron using flock with a frequency of one minute
Flock will check if the script is alive according to the lock file, and if not, then run it.
Finish the script so that it itself works as a demon.
It is possible through tmux or screen to launch and disconnect from the session. The script will continue to run.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question