Search code examples
google-cloud-platformcrongoogle-cloud-scheduler

Cloud scheduler trigger on the first monday of each month


I'm trying to schedule a job to trigger on the first Monday of each month:

This is the cron expression I got: 0 5 1-7 * 1 (which ,as far as I can read unix cron expressions, triggers at 5:00 am on Monday if it happens to be in the first 7 days of the month)

However the job is triggered on what seems to be random days at 5:00 am. the job was triggered today on the 16 of Aug!

Am I reading the expression awfully wrong? BTW, I'm setting the timezone to be on AEST, if that makes difference.


Solution

  • You can use the legacy cron syntax to describe the schedule.

    For your case, specify something like below:
    "first monday of month 05:00"

    Do explore the "Custom interval" tab in the provided link, to get better understanding on this.