A
A
Alexey Firsov2013-12-26 06:19:43
Python
Alexey Firsov, 2013-12-26 06:19:43

demon in python

Hello toaster!
In general, such a task is worth it, there is a python script that runs a cron every 5 minutes, but the script can work for 2 minutes or 20 minutes in time.
When starting the script, it is necessary to check if the script has worked and if so, then execute it; if not, then exit! I do not know how to solve this, tell me who can come across!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
alternativshik, 2013-12-26
@lesha_firs

with a file is the easiest option. Just what happens if the script fails with an error and the file remains? Here it is also possible that you need to monitor the date of modification of this file, if more than, for example, 30 minutes, then rewrite ...

R
Roman, 2013-12-26
@gen1s

When you run the script, you can write a file to / tmp, and delete it at the end of the work. And check if there is a file, then exit.

S
strib, 2013-12-26
@strib

Or look at processes...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question