D
D
Doniyor Mamatkulov2021-11-21 20:20:17
ubuntu
Doniyor Mamatkulov, 2021-11-21 20:20:17

How to limit the work of Cron'a to a period of time?

Hello.
The task is to run a python script on a schedule - every 15 minutes from 8:00 to 20:00.
Did it like this:

*/15 8-20 * * * /usr/bin/python3 /home/donik/python/sweeper.py >> /home/donik/python/sweeper_cron.log 2>&1

Timezone is correct, but the script continues to work after 20:00
Tell me how to fix it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2021-11-21
@D0nik

*/15 8-19 * * *...

K
ky0, 2021-11-21
@ky0

Much more flexible can be configured through systemd timers . Move on already, damn it, into the 21st century ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question