0

I've set up a crontab to run a php script every workday at 10:30 am, but it won't work. But if I change it to run every hour, every workday at xx:30 it works. I also successfully ran it to run every minute.

Has somebody an idea why?

  • Not working:

    30 10 * * 1-5 /usr/bin/php /path/to/php/script.php >/dev/null 2>&1
    30 8 * * 1-5 /usr/bin/php /path/to/php/script.php >/dev/null 2>&1
    30 08 * * 1-5 /usr/bin/php /path/to/php/script.php >/dev/null 2>&1
    
  • Working:

    30 * * * 1-5 /usr/bin/php /path/to/php/script.php >/dev/null 2>&1
    * * * * 1-5 /usr/bin/php /path/to/php/script.php >/dev/null 2>&1
    
Henry
  • 9

1 Answers1

0

The device was set to another time zone. Now it works.

The device was an Raspberry Pi, so I used

sudo raspi-config 

and changed the timezone in the "4 Localisation options". Doing this, the crontab updated itself .Before the cronjob was set at 10 am and the device was one hour before my timezone. After updating the timezone the cronjob was set to 11 am, so keep that in mind.

Henry
  • 9