CronJob
A thorough sysops toolkit for scanning, monitoring, reporting, and maintaining scheduled job operations. CronJob provides 18+ commands for tracking job events, performing health checks, managing backups, benchmarking performance, and exporting operational data in multiple formats.
Commands
| Command |
Description |
cronjob scan <input> |
Record a scan entry — run without args to view recent scan entries |
cronjob monitor <input> |
Record a monitoring observation — run without args to view recent entries |
cronjob report <input> |
Log a report entry — run without args to view recent reports |
cronjob alert <input> |
Record an alert — run without args to view recent alerts |
cronjob top <input> |
Log a top-level event — run without args to view recent entries |
cronjob usage <input> |
Track usage data — run without args to view recent usage entries |
cronjob check <input> |
Record a check result — run without args to view recent checks |
cronjob fix <input> |
Log a fix action — run without args to view recent fixes |
cronjob cleanup <input> |
Record a cleanup operation — run without args to view recent cleanups |
cronjob backup <input> |
Log a backup event — run without args to view recent backups |
cronjob restore <input> |
Record a restore operation — run without args to view recent restores |
cronjob log <input> |
Add a general log entry — run without args to view recent log entries |
cronjob benchmark <input> |
Record a benchmark result — run without args to view recent benchmarks |
cronjob compare <input> |
Log a comparison — run without args to view recent comparisons |
cronjob stats |
Display summary statistics across all log categories |
cronjob export <fmt> |
Export all data to a file (formats: json, csv, txt) |
cronjob search <term> |
Search across all log files for a keyword |
cronjob recent |
Show the 20 most recent activity entries from the history log |
cronjob status |
Health check — shows version, data directory, entry count, disk usage |
cronjob help |
Display available commands and usage information |
cronjob version |
Print current version (v2.0.0) |
Each data command (scan, monitor, report, etc.) works in two modes:
- With arguments: Records the input with a timestamp into its dedicated log file
- Without arguments: Displays the 20 most recent entries from that category
Data Storage
All data is stored locally in plain-text log files:
- Location:
~/.local/share/cronjob/
- Format: Each entry is saved as
YYYY-MM-DD HH:MM|<value> in per-category .log files
- History: All operations are additionally logged to
history.log with timestamps
- Export: The
export command can generate JSON, CSV, or TXT files from all log data
- No cloud sync — everything stays on your machine
Requirements
- Bash 4.0+ (uses
set -euo pipefail)
- Standard Unix utilities:
date, wc, du, head, tail, grep, basename, cat
- No external dependencies, no API keys, no network access required
- Works on Linux and macOS
When to Use
- Cron job monitoring — Track the execution status of scheduled jobs, log failures, and set up alerts for review
- Job audit trail — Record scan, check, and report entries to maintain a complete history of job operations
- Backup & restore logging — Log backup and restore events with timestamps so you always know what happened and when
- Performance benchmarking — Record benchmark results for scheduled tasks and compare them over time to spot regressions
- Operational data export — Export all collected logs in JSON, CSV, or TXT format for dashboards, compliance, or further analysis
Examples
# Record a scan of cron job health
cronjob scan "all 12 scheduled jobs ran successfully today"
# Log a monitoring observation
cronjob monitor "backup-job took 45min, 3x longer than usual"
# Record an alert for a failed job
cronjob alert "daily-report cron failed at 03:00 — exit code 1"
# Log a fix action taken
cronjob fix "increased timeout for backup-job from 30m to 90m"
# View summary statistics across all categories
cronjob stats
# Export all data to CSV for spreadsheet analysis
cronjob export csv
# Search for entries related to a specific job
cronjob search "backup-job"
# Quick health check
cronjob status
# View the 20 most recent activity entries
cronjob recent
Configuration
Set CRONJOB_DIR to change the data directory. Default: ~/.local/share/cronjob/
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
1---2name: cronjob3description: Manage cron jobs with execution logging and failure alert tracking. Use when adding tasks, monitoring execution, debugging failed crons.4---5# CronJob
6
7A thorough sysops toolkit for scanning, monitoring, reporting, and maintaining scheduled job operations. CronJob provides 18+ commands for tracking job events, performing health checks, managing backups, benchmarking performance, and exporting operational data in multiple formats.
8
9## Commands
10
11| Command | Description |
12|---------|-------------|
13| `cronjob scan <input>` | Record a scan entry — run without args to view recent scan entries |
14| `cronjob monitor <input>` | Record a monitoring observation — run without args to view recent entries |
15| `cronjob report <input>` | Log a report entry — run without args to view recent reports |
16| `cronjob alert <input>` | Record an alert — run without args to view recent alerts |
17| `cronjob top <input>` | Log a top-level event — run without args to view recent entries |
18| `cronjob usage <input>` | Track usage data — run without args to view recent usage entries |
19| `cronjob check <input>` | Record a check result — run without args to view recent checks |
20| `cronjob fix <input>` | Log a fix action — run without args to view recent fixes |
21| `cronjob cleanup <input>` | Record a cleanup operation — run without args to view recent cleanups |
22| `cronjob backup <input>` | Log a backup event — run without args to view recent backups |
23| `cronjob restore <input>` | Record a restore operation — run without args to view recent restores |
24| `cronjob log <input>` | Add a general log entry — run without args to view recent log entries |
25| `cronjob benchmark <input>` | Record a benchmark result — run without args to view recent benchmarks |
26| `cronjob compare <input>` | Log a comparison — run without args to view recent comparisons |
27| `cronjob stats` | Display summary statistics across all log categories |
28| `cronjob export <fmt>` | Export all data to a file (formats: `json`, `csv`, `txt`) |
29| `cronjob search <term>` | Search across all log files for a keyword |
30| `cronjob recent` | Show the 20 most recent activity entries from the history log |
31| `cronjob status` | Health check — shows version, data directory, entry count, disk usage |
32| `cronjob help` | Display available commands and usage information |
33| `cronjob version` | Print current version (v2.0.0) |
34
35Each data command (scan, monitor, report, etc.) works in two modes:
36- **With arguments**: Records the input with a timestamp into its dedicated log file
37- **Without arguments**: Displays the 20 most recent entries from that category
38
39## Data Storage
40
41All data is stored locally in plain-text log files:
42
43- **Location**: `~/.local/share/cronjob/`
44- **Format**: Each entry is saved as `YYYY-MM-DD HH:MM|<value>` in per-category `.log` files
45- **History**: All operations are additionally logged to `history.log` with timestamps
46- **Export**: The `export` command can generate JSON, CSV, or TXT files from all log data
47- **No cloud sync** — everything stays on your machine
48
49## Requirements
50
51- Bash 4.0+ (uses `set -euo pipefail`)
52- Standard Unix utilities: `date`, `wc`, `du`, `head`, `tail`, `grep`, `basename`, `cat`
53- No external dependencies, no API keys, no network access required
54- Works on Linux and macOS
55
56## When to Use
57
581. **Cron job monitoring** — Track the execution status of scheduled jobs, log failures, and set up alerts for review
592. **Job audit trail** — Record scan, check, and report entries to maintain a complete history of job operations
603. **Backup & restore logging** — Log backup and restore events with timestamps so you always know what happened and when
614. **Performance benchmarking** — Record benchmark results for scheduled tasks and compare them over time to spot regressions
625. **Operational data export** — Export all collected logs in JSON, CSV, or TXT format for dashboards, compliance, or further analysis
63
64## Examples
65
66```bash
67# Record a scan of cron job health
68cronjob scan "all 12 scheduled jobs ran successfully today"
69
70# Log a monitoring observation
71cronjob monitor "backup-job took 45min, 3x longer than usual"
72
73# Record an alert for a failed job
74cronjob alert "daily-report cron failed at 03:00 — exit code 1"
75
76# Log a fix action taken
77cronjob fix "increased timeout for backup-job from 30m to 90m"
78
79# View summary statistics across all categories
80cronjob stats
81
82# Export all data to CSV for spreadsheet analysis
83cronjob export csv
84
85# Search for entries related to a specific job
86cronjob search "backup-job"
87
88# Quick health check
89cronjob status
90
91# View the 20 most recent activity entries
92cronjob recent
93```
94
95## Configuration
96
97Set `CRONJOB_DIR` to change the data directory. Default: `~/.local/share/cronjob/`
98
99---
100
101*Powered by BytesAgain | bytesagain.com | hello@bytesagain.com*