I have two scripts, what I would like to do is:
- at 1am, the first one runs
- once the first one stops, and this is a condition, the second one fires
So, should i use:
[Service]
ExecStartPre = script.py
ExecStart = secondscript.py
or
[Service]
Type = oneshot
ExecStart = first.py
ExecStart = second.py
man
notes this:
Note that
ExecStartPre=
may not be used to start long-running processes. All processes forked off by processes invoked viaExecStartPre=
will be killed before the next service process is run.
And my scripts can be long-running ones (some hours each).
Or is there a better way to ensure second runs only after first is fully-executed?
Also, this service is called by a timer:
[Timer]
OnCalendar=*-*-* 1:00:00
Unit = script.service
and i want only one instance of this running; even if the script.service
takes 3 days to run, the next run should be reported to the next day after it finishes, at 1:00:00. Is this the default?