Search code examples
google-cloud-functionsgoogle-cloud-scheduler

Cloud Scheduler with multiple cron schedules?


I have a Scheduler Job within Cloud Scheduler running to call a Cloud Function. Working as expected however I need to create multiple cron schedules for the same job, is this possible without recreating from scratch each one? There doesn't seem to be a Copy function.

Use Case:

Schedule 1 - Every 15 minutes Monday - Thursday
Schedule 2 - Every 15 minutes Friday SoD till Friday 22:00PM
Schedule 3 - Every 15 minutes Sunday 22:00PM till Sunday EoD

How can I achieve this, or do I just need to recreate all the schedules from scratch?


Solution

  • Posting this as a Community Wiki as it's based on @GuillaumeBlaquiere and @Al-dann comments.

    At this point you going to need to recreate all of those schedules from scratch, however, you can automate the creation of new Jobs with a script, either with gcloud or terraform. This will make duplication, creation and deletion of Jobs easier and quicker as well as allow you to version it.