← 返回
开发者工具 中文

Cronjob

Manage cron jobs with execution logging and failure alert tracking. Use when adding tasks, monitoring execution, debugging failed crons.
管理 cron 任务,支持执行日志记录和失败告警追踪。适用于添加任务、监控执行及调试失败任务。
xueyetianya
开发者工具 clawhub v2.0.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 706
下载
💾 26
安装
2
版本
#latest

概述

CronJob

A comprehensive 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

CommandDescription
----------------------
cronjob scan Record a scan entry — run without args to view recent scan entries
cronjob monitor Record a monitoring observation — run without args to view recent entries
cronjob report Log a report entry — run without args to view recent reports
cronjob alert Record an alert — run without args to view recent alerts
cronjob top Log a top-level event — run without args to view recent entries
cronjob usage Track usage data — run without args to view recent usage entries
cronjob check Record a check result — run without args to view recent checks
cronjob fix Log a fix action — run without args to view recent fixes
cronjob cleanup Record a cleanup operation — run without args to view recent cleanups
cronjob backup Log a backup event — run without args to view recent backups
cronjob restore Record a restore operation — run without args to view recent restores
cronjob log Add a general log entry — run without args to view recent log entries
cronjob benchmark Record a benchmark result — run without args to view recent benchmarks
cronjob compare Log a comparison — run without args to view recent comparisons
cronjob statsDisplay summary statistics across all log categories
cronjob export Export all data to a file (formats: json, csv, txt)
cronjob search Search across all log files for a keyword
cronjob recentShow the 20 most recent activity entries from the history log
cronjob statusHealth check — shows version, data directory, entry count, disk usage
cronjob helpDisplay available commands and usage information
cronjob versionPrint 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| 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

  1. Cron job monitoring — Track the execution status of scheduled jobs, log failures, and set up alerts for review
  2. Job audit trail — Record scan, check, and report entries to maintain a complete history of job operations
  3. Backup & restore logging — Log backup and restore events with timestamps so you always know what happened and when
  4. Performance benchmarking — Record benchmark results for scheduled tasks and compare them over time to spot regressions
  5. 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

版本历史

共 2 个版本

  • v2.0.1 当前
    2026-03-29 16:23 安全 安全
  • v1.0.6
    2026-03-19 06:46

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Excel Formula

xueyetianya
根据描述生成Excel公式并诊断电子表格错误。适用于编写VLOOKUP公式、调试错误或转换公式。支持...
★ 2 📥 6,133
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 67 📥 180,046
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,773