G
G
gadzhi152017-05-23 08:39:28
linux
gadzhi15, 2017-05-23 08:39:28

Cron runs at the beginning of every hour. Why?

There is an entry:
*/14 * * * * python3 /home/G/script.py
But for some reason, cron also pulls the script at the beginning of each hour.
Here is the log:

May 23 05:16:01 localhost CRON[18472]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 23 05:28:01 localhost CRON[18621]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 05:42:01 localhost CRON[18695]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 05:56:01 localhost CRON[18805]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 06:00:01 localhost CRON[18831]: (gadzhibala) CMD (python3 /home/G/script.py)  
May 23 06:14:01 localhost CRON[18938]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 06:16:01 localhost CRON[18974]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 23 06:28:01 localhost CRON[19055]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 06:42:01 localhost CRON[19143]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 06:56:01 localhost CRON[19282]: (gadzhibala) CMD ((python3 /home/G/script.py)  
May 23 07:00:01 localhost CRON[19307]: (gadzhibala) CMD (python3 /home/G/script.py)  
May 23 07:14:01 localhost CRON[19533]: (gadzhibala) CMD (python3 /home/G/script.py)  
May 23 07:16:01 localhost CRON[19549]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 23 07:17:01 localhost CRON[19556]: (root) CMD (   test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond)
May 23 07:28:01 localhost CRON[19646]: (gadzhibala) CMD (python3 /home/G/script.py)  
May 23 07:42:01 localhost CRON[19782]: (gadzhibala) CMD (python3 /home/G/script.py)  
May 23 07:56:01 localhost CRON[19951]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 08:00:01 localhost CRON[19975]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 08:14:01 localhost CRON[20161]: (gadzhibala) CMD (python3 /home/G/script.py) 
May 23 08:16:01 localhost CRON[20187]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
May 23 08:28:01 localhost CRON[20312]: (gadzhibala) CMD (python3 /home/G/script.py)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2017-05-23
@gadzhi15

*/14 means "every 14 minutes", or rather, when the remainder of minutes divided by 14 is 0.
This is the 0, 14, 28, 42, 56minutes of every hour.
If you want the script to be executed only once per hour at the 14th minute, remove */:
Several times per hour at certain minutes - list them:
14,28,42,56 * * * * python3 /home/G/script.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question