laravel schedule task to run every 10 days of a mo

2019-08-14 03:25发布

问题:

I have a task which I need to execute for the first 10 days of every month

something like below:

$schedule->command('log:test')->cron('* * 1-10 * *');

seems cron() is not getting executed... though everyMinute() is working fine... How can I get this to work?

回答1:

You have to fill the hour and minutes on the cron. Try this one if you want it get executed at the start of the day.

$schedule->command('log:test')->cron('0 0 1-10 * *');