A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/appengine/docs/legacy/standard/python/config/cronref below:

cron.yaml Reference | App Engine standard environment for Python 2

Skip to main content cron.yaml Reference

Stay organized with collections Save and categorize content based on your preferences.

Use the cron.yaml file to define scheduled tasks for your application.

To learn more about scheduling tasks, including how to test, deploy, or delete Cron jobs, see Scheduling Tasks with Cron.

Note: Uploading a cron.yaml file via the gcloud CLI below version 322.0.0. uses a deprecated interface to the service. Starting on 2022-09-20, attempts to use the upload method can fail with server errors. To resolve this, make sure the Cloud Scheduler API is enabled in your project and your gcloud CLI is updated to at least version 322.0.0. . Example

The following is an example cron.yaml file:

cron:
- description: "daily summary job"
  url: /tasks/summary
  schedule: every 24 hours
- description: "monday morning mailout"
  url: /mail/weekly
  schedule: every monday 09:00
  timezone: Australia/NSW
- description: "new daily summary job"
  url: /tasks/summary
  schedule: every 24 hours
  target: beta
Syntax

The

cron.yaml

file should reside in the root directory of your application alongside

app.yaml

:

cron.yaml

configures scheduled tasks for your Python 2 application.

For more information about the YAML format, see

the YAML website

.

Cron job definitions Element Description description Optional. The description is visible in the Google Cloud console and the development server's admin interface. Surround the description value in quotes. retry_parameters Optional. If a cron job's request handler returns a HTTP status code that is not in the range 200–299 (inclusive) App Engine considers the job to have failed. By default, failed jobs are not retried. You can cause failed jobs to be retried by including a retry-parameters block in your configuration file.

See the Cron retries section for more information.

schedule Required. Defines the schedule of when the cron job runs, see the syntax below. target

The target string is prepended to your app's hostname. It is usually the name of a service. The cron job will be routed to the version of the named service that is configured for traffic.

Warning: Be careful if you run a cron job with traffic splitting enabled. The request from the cron job is always sent from the same IP address, so if you've specified IP address splitting, the logic will route the request to the same version every time. If you've specified cookie splitting, the request will not be split at all, because there is no cookie accompanying the request.

If the service name that is specified for target is not found, then the Cron request is routed to either the default service, or to the version of your app that is configured to receive traffic.For more information about routing, see How Requests are Routed.

If you use a dispatch file, your job might be re-routed. For example, given the following cron.yaml and dispatch.yaml files, the job will run in service2, even though its target is service1:

# cron.yaml
cron:
- description: "test dispatch vs target"
  url: /tasks/hello_service2
  schedule: every 1 mins
  target: service1

# dispatch.yaml:
dispatch:
- url: '*/tasks/hello_service2'
  service: service2
timezone The timezone should be the name of a standard zoneinfo time zone name. If you don't specify a timezone, the schedule will be in UTC (also known as GMT). url Required. The url field specifies a URL in your application that will be invoked by the Cron Service. See Securing URLs for Cron for more information. Defining the cron job schedule Note: Uploading a cron.yaml file via the gcloud CLI below version 322.0.0. uses a deprecated interface to the service. Starting on 2022-09-20, attempts to use the upload method can fail with server errors. To resolve this, make sure the Cloud Scheduler API is enabled in your project and your gcloud CLI is updated to at least version 322.0.0. .

Cron jobs are scheduled on reoccurring intervals and are specified using a simple English-like format. You can define a schedule so that your job runs multiple times a day, or runs on specific days and months.

Sub-daily intervals

Use a sub-daily interval to run a job multiple times a day on a repetitive schedule. You can define either an end-time interval, or a start-time interval:

Custom interval

You can use a custom interval to define a schedule where your job can run once per day on one or more select days, and in one or more select months. Jobs that run on a custom schedule run year-round, only at the specific time on the select days and months.

Example: For the 1,2,3 of month 07:00 schedule, the job runs one time at 07:00 on the first three days of each month.

Important considerations for schedule:

Formatting the schedule

To specify when your job runs, you must define the schedule element using the following syntax:

schedule: [TYPE] [INTERVAL_VALUE] [INTERVAL_SCOPE]

Choose an interval type to define your schedule element:

End-time interval
End-time interval examples
Use the following examples to help you understand how to define job schedules that use an end-time interval:
Start-time interval
Start-time interval examples
Use the following examples to help you understand how to define job schedules that use a start-time interval:
Custom interval
Custom interval examples
Use the following examples to help you understand how to define job schedules that use a custom interval:
Cron retries

If a cron job's request handler returns a status code that is not in the range 200–299 (inclusive) App Engine considers the job to have failed. By default, failed jobs are not retried. You can cause failed jobs to be retried by including a retry_parameters block in your configuration file.

Here is a sample cron.yaml file that contains a single cron job configured to retry up to five times (the default) with a starting backoff of 2.5 seconds that doubles each time.

cron:
- description: "retry demo"
  url: /retry
  schedule: every 10 mins
  retry_parameters:
    min_backoff_seconds: 2.5
    max_doublings: 5
Cron retries syntax

The retry parameters are described in the table below.

Element Description job_retry_limit The maximum number of retry attempts for a failed cron job not to exceed 5. If specified with job_age_limit, App Engine retries the cron job until both limits are reached. When omitted from the parameters, the limit is set to 5 by default. job_age_limit The time limit for retrying a failed cron job, measured from when the cron job was first run. The value is a number followed by a unit of time, where the unit is s for seconds, m for minutes, h for hours, or d for days. For example, the value 5d specifies a limit of five days after the cron job's first execution attempt. If specified with job_retry_limit, App Engine retries the cron job until both limits are reached. min_backoff_seconds The minimum number of seconds to wait before retrying a cron job after it fails. max_backoff_seconds The maximum number of seconds to wait before retrying a cron job after it fails. max_doublings The maximum number of times that the interval between failed cron job retries will be doubled before the increase becomes constant. The constant is: 2**(max_doublings - 1) * min_backoff. Cron requests

Requests from the Cron Service will contain a HTTP header:

X-Appengine-Cron: true

This and other headers are set internally by App Engine. If a client sends these headers, they are removed from the request. The exception being requests from logged in administrators of legacy apps, who are allowed to set the header for testing purposes.

Originating IP address

App Engine issues Cron requests from the IP address 0.1.0.2. For Cron jobs created with older gcloud versions (earlier than 326.0.0), Cron requests will come from 0.1.0.1.

Request timeout

The cron request timeout depends on the scaling type that is configured for your app:

Automatic scaling
Request timeout of 10 minutes.
Basic scaling and manual scaling
Request timeout of 24 hours.

For more information, see How instances are managed.

Limits

Free applications can have up to 20 scheduled tasks. Paid applications can have up to 250 scheduled tasks.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["The `cron.yaml` file is used to define scheduled tasks for your Python 2 application, allowing for the configuration of recurring jobs with specific URLs and schedules."],["Cron job schedules can be defined using either sub-daily intervals for frequent tasks or custom intervals for tasks that run on specific days and months, but these types can't be mixed."],["When configuring cron job retries, you can specify parameters such as `job_retry_limit`, `job_age_limit`, `min_backoff_seconds`, `max_backoff_seconds`, and `max_doublings` to control how and when failed jobs are retried."],["Cron requests are sent with a unique HTTP header `X-Appengine-Cron: true` and originate from specific IP addresses, and the timeout for these requests varies depending on the application's scaling type, with automatic scaling having a 10-minute limit and basic/manual scaling having a 24-hour limit."],["It is important to be sure that the Cloud Scheduler API is enabled in your project and that your gcloud CLI is at least version `322.0.0` to avoid errors uploading a `cron.yaml` file, and that your application code is idempotent to handle potential duplicate job requests."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4