Documentation

Cron Jobs - Automated Task Scheduling

Schedule and automate HTTP requests to your services with deployra's powerful cron job system. Perfect for periodic tasks, data processing, notifications, and maintenance operations.

Task Automation
Scheduled Requests
Cron Syntax
HTTP Triggers

What are Cron Jobs?

Deployra Cron Jobs enable you to schedule automated HTTP requests to your services at specific intervals. This powerful feature transforms your applications into self-managing systems that can perform routine tasks without manual intervention.

Data Processing

Automate ETL operations, data cleanup, and batch processing tasks

Notifications & Reports

Send scheduled emails, alerts, and generate periodic reports

Cache Management

Refresh cached data, clear temporary files, and optimize performance

Database Maintenance

Run backups, optimize indexes, and perform routine maintenance

API Integrations

Sync data with external services and update third-party systems

Scheduled Tasks

Execute any recurring task that can be triggered via HTTP endpoint

deployra cron job configuration interface showing schedule setup and HTTP request settings

deployra Cron Job Interface: Configure schedules, HTTP methods, URLs, and monitoring settings through our intuitive dashboard.

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.

Frequently Asked Questions

What is the minimum interval for cron jobs?

The minimum interval between cron job executions is 5 minutes. This prevents excessive resource usage and ensures system stability. For tasks requiring higher frequency, consider implementing them within your application using internal schedulers.

How do I handle authentication for cron job endpoints?

Use custom headers or API keys to authenticate cron job requests. You can configure custom headers in the cron job settings, such as X-Cron-Secret: your-secret-key. Validate this header in your endpoint to ensure only authorized cron jobs can trigger your tasks.

What happens if my cron job fails?

deployra automatically retries failed cron jobs with exponential backoff. You can monitor job execution status and logs in the cron jobs dashboard. Failed jobs are logged with error details to help you troubleshoot and fix issues.

Can I schedule cron jobs in my local timezone?

All cron jobs execute in UTC timezone. You need to convert your local time to UTC when setting schedules. For example, if you want a job to run at 9 AM EST, set it for 2 PM UTC (14:00). This ensures consistent execution regardless of server location.

How many cron jobs can I create per service?

The number of cron jobs depends on your deployra plan. Free tier allows up to 3 cron jobs per service, while paid plans offer higher limits. Check your dashboard for current usage and upgrade options if you need more cron jobs.

What HTTP methods are supported for cron jobs?

deployra cron jobs currently support GET requests only. You can configure custom headers and query parameters for each cron job to match your endpoint requirements. If you need to trigger POST, PUT, or other HTTP methods, design your GET endpoint to initiate those operations internally.