- gcloud scheduler jobs create app-engine - create a Cloud Scheduler job with an App Engine target
gcloud scheduler jobs create app-engine
HTTP_METHOD; default="post"] [
MAX_BACKOFF; default="1h"] [
MAX_DOUBLINGS; default=16] [
MIN_BACKOFF; default="5s"] [
RELATIVE_URL; default="/"] [
TIME_ZONE; default="Etc/UTC"] [
- Create a Cloud Scheduler job with an App Engine target.
The following command creates a job that sends a request to the '/cron-handler'
path in you App Engine app every 3 hours:
gcloud scheduler jobs create app-engine my-job --schedule="0 */3 * * *"--relative-url="/cron-handler"
- POSITIONAL ARGUMENTS
Job resource - Job to create. This represents a Cloud resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other ways.
To set the
projectattribute: provide the argument
jobon the command line with a fully specified name; provide the argument
--projecton the command line; set the property
core/project. To set the
locationattribute: provide the argument
jobon the command line with a fully specified name; as the location of the current project's App Engine App. This must be specified.
ID of the job or fully qualified identifier for the job. To set the
jobattribute: provide the argument
jobon the command line.
- Job resource - Job to create. This represents a Cloud resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the
- REQUIRED FLAGS
Schedule on which the job will be executed.
As a general rule, execution
n + 1of a job will not begin until execution
nhas finished. Cloud Scheduler will never allow two simultaneously outstanding executions. For example, this implies that if the
n+1execution is scheduled to run at
nexecution takes until
n+1execution will not start until
16:15. A scheduled start time will be delayed if the previous execution has not ended when its scheduled time occurs.
If --retry-count > 0 and a job attempt fails, the job will be tried a total of --retry-count times, with exponential backoff, until the next scheduled start time.
The schedule can be either of the following types:
- Crontab: http://en.wikipedia.org/wiki/Cron#Overview
- English-like schedule: https://cloud.google.com/scheduler/docs/quickstart#defining_the_job_schedule
- OPTIONAL FLAGS
- The deadline for job attempts. If the request handler doesn't respond by this dealine, the request is cancelled and the attempt is marked as failed. For example, 20s.
- Human-readable description of the job.
KEY=VALUE pairs of HTTP headers to include in the request.
Cannot be repeated. For example:
HTTP method to use for the request.
HTTP_METHODmust be one of:
Maximum amount of time to wait before retrying a task after it fails. For
10m. Default is
- Maximum number of times that the interval between failed job retries will be doubled before the increase becomes constant.
- Number of times to retry the request if it fails or times out. Must be in range 0-5 inclusive. Default is 0.
Time limit for retrying a failed task, measured from when the task was first
run. If specified with
--max-retry-attemptsgreater than 0, the task will be retried until both limits are reached. Default is 0 (which means unlimited).
Minimum amount of time to wait before retrying a task after it fails. For
10s. Default is
- Relative URL to use for the request (beginning with "/").
- ID of the App Engine service to send the request to.
Specifies the time zone to be used in interpreting --schedule. The value of this
field must be a time zone name from the tz database
Note that some time zones include a provision for daylight savings time. The rules for daylight saving time are determined by the chosen time zone.
For UTC use the string "utc". Default is "utc".
- Version of the App Engine service to send the request to.
At most one of these may be specified:
- Data payload to be included as the body of the HTTP request. May only be given with compatible HTTP methods (PUT or POST).
- Path to file containing the data payload to be included as the body of the HTTP request. May only be given with compatible HTTP methods (PUT or POST).
- GCLOUD WIDE FLAGS
These flags are available to all commands:
$ gcloud helpfor details.
- API REFERENCE
This command uses the
cloudscheduler/v1API. The full documentation for this API can be found at: https://cloud.google.com/scheduler/
- These variants are also available:
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 2021-03-23 UTC.