cortex jobs

Manage scheduled cron jobs that run on the daemon scheduler. Jobs are persisted in SQLite with retry logic and status tracking.

Usage

cortex jobs add --schedule "<cron>" --task <command>   # Add a scheduled job
cortex jobs list                                        # List all jobs
cortex jobs remove <job_id>                             # Remove a job
cortex jobs pause <job_id>                              # Pause a job
cortex jobs resume <job_id>                             # Resume a paused job

Subcommands

SubcommandDescription
addCreate a new scheduled job
listList all jobs with their status
removeDelete a job by ID
pausePause a job without deleting it
resumeResume a paused job

Options

OptionDescription
--scheduleCRON expression (e.g., 0 9 * * 1 for weekly Monday 9AM)
--taskCommand or task to execute
--helpShow help for this command

Scheduler Behavior

  • The scheduler daemon polls the database every 30 seconds for due jobs
  • On failure, jobs are retried with configurable backoff
  • Execution history is logged for audit
  • Memory consolidation can be scheduled as a recurring job

CRON Format

┌───────── minute (0-59)
│ ┌───────── hour (0-23)
│ │ ┌───────── day of month (1-31)
│ │ │ ┌───────── month (1-12)
│ │ │ │ ┌───────── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *

Examples

# Add a weekly report generation job every Monday at 9 AM
cortex jobs add --schedule "0 9 * * 1" --task "generate-weekly-report"

# List all jobs
cortex jobs list

# Pause a job temporarily
cortex jobs pause job_xyz789

# Resume a paused job
cortex jobs resume job_xyz789

# Remove a completed or unwanted job
cortex jobs remove job_xyz789