Documentation

Cronjobs & Scheduled Tasks

Manage recurring jobs, task schedules, and batch automation.

Schedule and manage automated tasks, batch jobs, and recurring workflows with NebuaCloud's powerful job scheduling system. Built on Kubernetes CronJobs with enterprise features.

Overview

NebuaCloud Cronjobs provides a robust platform for scheduling recurring tasks, batch processing, and automated workflows. Execute database maintenance, report generation, data backups, and custom automation with reliability and precision.

Key Features

  • Flexible Scheduling - Cron expressions and human-readable schedules
  • Job Templates - Reusable job configurations and best practices
  • Execution History - Complete audit trail of job runs and outcomes
  • Failure Handling - Retry policies, dead letter queues, and notifications
  • Resource Management - CPU, memory, and timeout controls per job

Getting Started

Creating Your First Cronjob

  1. Navigate to Cronjobs - Access the Cronjobs section in your dashboard
  2. Create New Job - Click "Create Cronjob" to start
  3. Configure Schedule - Set timing using cron expressions or presets
  4. Define Task - Specify container image, command, and parameters
  5. Set Resources - Configure CPU, memory, and timeout limits
  6. Enable Job - Activate the scheduled task

When To Use Cronjobs

Use Cronjobs when you need recurring automation that runs on a schedule instead of a long-lived application.

Common examples:

  • database backups
  • report generation
  • cache cleanup
  • data import and export jobs
  • webhook polling or synchronization tasks
  • scheduled maintenance scripts

What A Cronjob Defines

Each cronjob usually includes:

  • a name for the task
  • a schedule
  • a container image
  • the command or arguments to run
  • optional environment variables
  • resource limits such as CPU and memory
  • retry and timeout settings

Schedule Formats

NebuaCloud supports standard cron expressions and may also provide presets in the dashboard.

Examples:

  • 0 * * * * runs every hour
  • 0 2 * * * runs every day at 02:00
  • 0 3 * * 0 runs every Sunday at 03:00
  • */15 * * * * runs every 15 minutes

Example Tasks

Database Backup

Use a backup container or maintenance image that writes a dump to object storage or another backup target.

pg_dump "$DATABASE_URL" > /backups/backup-$(date +%F).sql

Cache Cleanup

Run a lightweight maintenance container that removes expired cache entries or temporary files.

node scripts/cleanup-cache.js

Report Generation

Run a reporting job that aggregates data and stores the result in a bucket, sends email, or updates an internal dashboard.

python jobs/generate_report.py --period daily

Best Practices

  • keep each cronjob focused on one task
  • use idempotent commands when possible so reruns are safe
  • set CPU, memory, and timeout limits explicitly
  • store credentials in secrets, not in plain command arguments
  • monitor execution history to catch repeated failures early
  • start with a manual test run before enabling a production schedule

Troubleshooting

Job Does Not Start

  • verify the cron expression is valid
  • confirm the cronjob is enabled
  • check that the image and command are valid
  • review namespace and permission settings

Job Fails Repeatedly

  • inspect execution logs and recent run history
  • verify environment variables and secrets
  • confirm external services such as databases, APIs, or storage are reachable
  • increase timeout or memory if the task is being terminated early

Job Runs Too Often Or At The Wrong Time

  • review the cron expression carefully
  • confirm the expected timezone in your environment
  • test with a simple schedule before applying a production schedule

Profile picture

Written with love by Nebuacloud, Private Cloud Infrastructure Automation Platform.

This site uses cookies to improve the user's experience.