I have a problem with Magento cron expression. It works fine with minutes:
<crontab>
<jobs>
<namespace_module_cron>
<schedule>
<cron_expr>*/15 * * * *</cron_expr>
</schedule>
<run>
<model>namespace_module/observer::myMethod</model>
</run>
</namespace_module_cron>
</jobs>
</crontab>
But it doesn’t work when I set hours:
<cron_expr>0 1 * * *</cron_expr>
or
<cron_expr>0 */1 * * *</cron_expr>
I tried different time settings in admin panel. For now there are:
- 15
- 1
- 60
- 120
- 120
- 3000
P.S. Magento ver. 1.7.0.1
Update
I left every hour job (0 */1 * * *) for a day and it actually runs:
- 14:15
- 16:15
- 21:15
- 22:15
- 03:15
- 04:15
I’ve figured out what was wrong. It were settings (System/Configuration/System/Cron).
When I set up “Schedule Ahead for” to 60 it started to work properly (every hour and every day schedules).
For now schedule in database is appearing at 15:20 when I need to execute it 16:00.
Settings:
If you have the same problem, you should pay attention to first two settings: “Generate Schedules Every” and “Schedule Ahead for”