Documentation

Cron Jobs

Schedule periodic HTTP requests to your services.

Deployra Cron Jobs allow you to set up automated HTTP requests that are sent to your services at scheduled intervals. This is perfect for triggering periodic tasks like:

  • Running data processing or cleanup scripts
  • Sending scheduled notifications or reports
  • Refreshing cached data
  • Triggering database maintenance
  • Executing any recurring task that can be initiated via an HTTP endpoint
Selecting a free instance type

How Cron Jobs Work

1. Schedule

Set up a schedule using cron syntax (e.g., 0 * * * * for hourly) or select from preset intervals.

2. HTTP Request

Configure the HTTP method, URL, headers, and payload that will be sent to your service.

3. Execution

Deployra automatically sends the configured request to your service at the scheduled times.

Creating a Cron Job

1

Navigate to your service

Go to your service's dashboard in the Deployra platform

2

Select "Cron Jobs" from the sidebar

Find the Cron Jobs section in your service's navigation menu

3

Click "Create Cron Job"

Open the form to configure a new cron job

4

Configure your cron job

Set up the schedule, HTTP method, URL path, and other options

5

Save and activate

Your cron job will start running according to the schedule you set

Cron Schedule Syntax

Common Cron Expressions
Quick reference for frequently used schedules
*/5 * * * *Every 5 minutes
0 * * * *Every hour
0 0 * * *Every day at midnight
0 9 * * 1-5Weekdays at 9:00 AM
0 0 1 * *First day of month at midnight

Best Practices

Use dedicated endpoints

Create specific routes in your application for cron job operations. This makes monitoring and debugging easier.

Add authentication

Use custom headers for authentication to ensure only your cron jobs can trigger these endpoints.

Monitor job execution

Check the cron job logs regularly to ensure jobs are running successfully.

Implement idempotency

Design your endpoints to handle repeated calls gracefully, in case a job runs multiple times.