-3

Is there a way to create a cron expression to run for every half an hour during the day and every 4 hours during the night?

I am using this cron expression inside a cloud scheduler that runs the GCP cloud function.

  • From the cron tag: Questions about configuring cron for systems or administration are OFF TOPIC. – Rob Mar 29 '23 at 17:11

1 Answers1

1

I think this should do the trick:

0,30 7-23,0-6/4 * * *

So this runs on every 0th and 30th minute of the hour from 7 til 23 and then every 4th hour from 0 to 6.

You can also have crontab.guru explain it to you.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807