Skip to Content
Cron Jobs

Update an existing Cron Job

PUT
/cron-jobs/{cron_job_id}

Path Parameters

cron_job_id*integer

The ID of the cron job.

Range1 <= value

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Request Body

A JSON object containing the resource data

application/json
  1. body
id*integer

The unique ID of the given Cron Job.

pattern*string

A cron expression consisting of Minute, Hour, Day of Month, Month and Day of Week subexpressions.

name*string

The name of the cron job. Must not be greater than 60 characters.

command*string

The command line to be executed when running the cron job. Must be at least 5 characters. Must not be greater than 255 characters.

run_as_user*string

The name of the system user on behalf of which the cron job will be executed. Must not be greater than 60 characters.

application_id?integer

Numeric ID of the application to which the cron job belongs to.

Response Body

No Content

Example Request
curl -X PUT 'https://api.devopness.com/cron-jobs/123' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json' \  -H 'Content-Type: application/json' \  -d '{  "id": 1,  "pattern": "0 0 * * *",  "name": "My cool cron job",  "command": "echo '\''devopness rocks!'\'' | tee -a /tmp/task-output.log",  "run_as_user": "root"}'
Example Response
Empty