Home > Back-end >  Google Cloud cron.yaml Intervals
Google Cloud cron.yaml Intervals

Time:09-17

I'm trying to customise a cronjob to schedule run a function in Google Cloud. I've been reading the documentation and as per title, one thing confuses me.

The documentation mentions that every prefix must be used if the function is to be repeated at a DAILY interval. But it is not clear on how it works if you want a function to be repeated at a WEEKLY, MONTHLY, or in my specific case, YEARLY intervals.

I've added schedule: 1 of jan 00:10 to my cron.yaml, am I correct to assume that this will be repeated every 1st of January, 10 minutes after midnight or will it only run once? Do I need to change it to schedule: every 1 of jan 00:10 ?

For the record, I found a similar question here on SO, but the problem is said question was asked and answered 10 years ago, so I dont know how applicable it still is.

CodePudding user response:

Yes, it is like you said, schedule: 1 of jan 00:10 will work for you. It will be repeated on 1st of Jan every year at 12:10 am.

Similarly, to run weekly: schedule: every monday 00:00

Monthly: schedule: 1 of month 09:00

For more such examples and verification you can refer to “Custom interval” section in this documentation

  • Related