Best way of scheduling a task that runs at four different schedules (Laravel / PHP)
<p>In a Laravel app we have a task that needs to run (for example) every hour for some users, every two hours for other users, every 4 hours for other users and every six hours for everyone else.</p>

<p>Whilst we could create four different commands, and use the in-built scheduler to run them via cron at  via cron at the relevant intervals, that seems somewhat clunky to me. </p>

<p>Is there a more elegant, and concise, way of achieving the desired outcome in one command and one</p>

<p>The only thought I had, and I'm not sure how reliable it would be, would be to run the task every hour, but then have the command look at the time that it's run, each time it's run. So it would automatically include all the hourly users in the list of users to be processed each time, but then if the hour is 0, 2, 4, 6, etc., also include the two hourly users, if it's 0, 4, 8, also include the four hourly users, and so on - again, though, that seems somewhat inelegant.</p>

<p>Any thoughts?</p>