Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ali2535's avatar

Run Cronjob Every X Minutes

How can i run cronjob every X minutes for example 43 minutes? is this right?

$schedule->command('command')->cron("*/43 * * * *")->withoutOverlapping();
0 likes
2 replies
gMagicScott's avatar

When you use */{int} you are saying "at every minute evenly divisible by {int}"

*/43 * * * * will run twice an hour. First at 00, then again at 43

Examples like */5 * * * * for every five minutes work out perfectly. Odd numbers, not so much.

You will have to get a little fancy to do what you want. Something like this (untested):

$time = Cache::get('my-command-next-time', now()->format('H:i'));
$schedule->command('command')->at($time)->after(function() {
    Cache::put('my-command-next-time', now()->addMinutes(43)->format('H:i'), now()->addHour());
});

Please or to participate in this conversation.