Go back

Why does schedule-monitor:sync change the expected cron expression?

If your scheduled command uses any of the unsupported methods in the Laravel Schedule Monitor package (e.g. between) you will need to use the cron method with the full expression which will allow the package to sync with Oh Dear correctly.

Supported method expects your command to run every four hours:

$schedule->command('your-command')->everyFourHours()->thenPing(...);

Unsupported 'between' will sync 'every four hours' only:

$schedule->command('your-command')->everyFourHours()->between('7:00', '23:00')->thenPing(...);

Updated command syncs the exact cron expression specified:

$schedule->command('your-command')->cron('0 7-23/4 * * *')->thenPing(...);

Want to get started? We offer a no-strings-attached 30 day trial. No credit card required.

Start monitoring

You're all set in
less than a minute!