I set my cron job via crontab -e
, with the following code:
* */1 * * * python /var/www/your_script >/dev/null 2>&1
I didn't add .py
extension as it makes the cron job invalid.
However, after logging it by grep CRON /var/log/syslog
, the script is executed every one minute, not every one hour.
Mar 1 07:40:01 my-instance CRON[4471]: (me) CMD (python /var/www/your_script >/dev/null 2>&1)
Mar 1 07:41:01 my-instance CRON[4474]: (me) CMD (python /var/www/your_script >/dev/null 2>&1)
Mar 1 07:42:01 my-instance CRON[4477]: (me) CMD (python /var/www/your_script >/dev/null 2>&1)
Why does my script start to be run every one minute, not every one hour? My environment is Ubuntu 16.04.
0 * * * *
which means 0 minutes after every full hour. – IQV Mar 1 '17 at 7:57