Skip to content
Advertisement

laravel run command / cron every 7 seconds on sunday

So i would like to accomplish the a command which runs every sunday but also every 7 seconds on that sunday.

The following is from the docs but I don’t have an idea on how to achieve this. Anyone able to direct me in the right direction?

protected function schedule(Schedule $schedule)
{
    $schedule->command('test:cron')
             ->everyMinute();
}

Advertisement

Answer

This will run the command sunday every minute:

protected function schedule(Schedule $schedule)
{
    $schedule->command('test:cron')->cron('* * * * SUN');
}

Check it here

PS: I don’t think you can use cron to go lower than “every minute”.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement