This chapter covers the core features and capabilities of Task Scheduler.
*, */n, a-b, a,b,c, and combinationscatch_up (fire immediately on overdue) or skip (wait for next window)heartbeat, disk_usage, and cleanup_tmp for testing without shell commands--once runs one scheduler pass and exits (ideal for testing and cron-driven invocation)Follow this guide to get Task Scheduler up and running in your environment.
# Show all CLI options
python src/task_scheduler.py --help
# List tasks with their next scheduled fire times
python src/task_scheduler.py --config examples/task_scheduler_config.json --list
# Run a single scheduler tick (fires due tasks, then exits)
python src/task_scheduler.py --config examples/task_scheduler_config.json --once
# Start the daemon loop (Ctrl-C to stop)
python src/task_scheduler.py --config examples/task_scheduler_config.json
# Override state file location and log level
python src/task_scheduler.py --config examples/task_scheduler_config.json --state-file /tmp/state.json --log-level DEBUGCreate a JSON config to define your task schedule:
{
"settings": {
"max_concurrency": 3,
"tick_interval": 1.0,
"state_file": "scheduler_state.json"
},
"tasks": [
{
"name": "my-task",
"schedule_type": "cron",
"schedule_value": "*/5 * * * *",
"command": "echo 'hello'",
"priority": 3,
"retry_limit": 2,
"retry_backoff": 2.0,
"missed_policy": "skip",
"enabled": true
}
]
}| Flag | Default | Description |
|---|---|---|
--config, -c | *(required)* | Path to the JSON schedule config file |
--once | false | Execute a single scheduler tick then exit |
--list | false | Print every task with its next fire time and exit |
--state-file | | Override the state-file path |
--log-level | INFO | Logging verbosity (DEBUG, INFO, WARNING, ERROR) |
Standard 5-field format: minute hour day-of-month month day-of-week
| Field | Range | Examples |
|---|---|---|
| Minute | 0β59 | 0, */5, 0,15,30,45 |
| Hour | 0β23 | 9, 0-8, */2 |
| Day of month | 1β31 | 1, 1,15, 10-20 |
| Month | 1β12 | *, 1,4,7,10, 6-8 |
| Day of week | 0β7 | 1-5 (MonβFri), 0 or 7 (Sun) |
Operators: * (all), */n (step), a-b (range), a-b/n (range+step), a,b,c (list).
| Task Field | Type | Default | Description |
|---|---|---|---|
name | string | *(required)* | Unique task identifier |
schedule_type | string | *(required)* | "cron", "interval", or "once" |
schedule_value | string | *(required)* | Cron expression, seconds, or ISO datetime |
command | string | "" | Shell command to execute |
builtin | string | "" | Name of a built-in callable (heartbeat, disk_usage, cleanup_tmp) |
priority | int | 5 | 1 (highest) to 10 (lowest) |
retry_limit | int | 3 | Max retry attempts on failure |
retry_backoff | float | 2.0 | Exponential backoff multiplier (delay = backoff ^ attempt) |
missed_policy | string | "skip" | "skip" (next window) or "catch_up" (fire immediately) |
enabled | bool | true | Set false to suspend without removing |
Get the full Task Scheduler and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.