Cron jobs
With cron jobs, you can schedule tasks that run at a defined time or regular intervals. The use case for cron jobs includes administration tasks that need to reoccur. For example, perhaps you need to send out an email every day that includes a report about the environment.
For each language, cron jobs are configured a little bit differently. See the Further reading section to find detailed configuration information for various languages. The cron jobs are defined in YAML format and placed in the cron.yaml
file.
The following is a YAML file that will run the task every 24 hours:
- The actual task is to run it using the handler defined under the
url
parameter:cron: - description: "daily summary job" url: /tasks/summary target: beta schedule: every 24 hours
- To deploy the
cron
job, use the following command:gcloud app deploy cron.yaml --project <project_id>
- Once deployed, the jobs will be visible via Cloud Scheduler. In the Google...