Skip to content

Latest commit

 

History

History
108 lines (79 loc) · 2.73 KB

File metadata and controls

108 lines (79 loc) · 2.73 KB

shimkit 0.6.0

shimkit cron — generic user-crontab editor. First of the deferred v0.6+ candidates from the v0.5.0 validation report. For the full machine-readable changelog, see CHANGELOG.md.


TL;DR

shimkit cron show               # full crontab
shimkit cron list               # shimkit-managed entries only
shimkit cron add --name backup --schedule "0 3 * * *" --cmd /usr/local/bin/dump.sh
shimkit cron remove backup
shimkit cron rollback           # restore the latest backup

Atomic write via crontab <tempfile>. Backup-on-mutate to ~/.shimkit/data/cron/crontab-YYYYMMDDHHMMSS.bak so a bad add is one shimkit cron rollback away.


What's new

shimkit cron

Identifies shimkit-managed entries by a configurable comment marker:

# user-authored noise stays untouched
@reboot /opt/legacy/startup.sh

# shimkit:backup nightly DB dump
0 3 * * * /usr/local/bin/dump.sh

list only shows the marker-tagged entries. remove only deletes marker-tagged entries — your own crontab lines are never touched.

Structural schedule validation: 5-field expressions or @reboot/@yearly/@annually/@monthly/@weekly/@daily/@hourly. Semantic validation (numeric ranges, alphabetic name validity) is left to cron itself; if cron rejects the loaded file, shimkit surfaces its error text. The backup means a bad add is recoverable.

Cap of 200 managed entries by default (configurable via tools.cron.max_managed_entries) so a runaway config can't explode the crontab.

Examples

# Nightly DB backup
shimkit cron add --yes \
    --name backup \
    --schedule "0 3 * * *" \
    --cmd "/usr/local/bin/dump.sh" \
    --comment "nightly DB dump"

# @hourly log rotation
shimkit cron add --yes \
    --name rotate \
    --schedule @hourly \
    --cmd "/opt/log/rotate.sh"

# Preview without writing
shimkit cron add --yes --dry-run \
    --name probe --schedule @daily --cmd /bin/true

# Got into a bad state?
shimkit cron rollback --yes

Charter context

The source ubuntu add:cron.sh was Laravel-specific (hardcoded php artisan schedule:run). shimkit cron is the generic host-side editor — bring your own schedule and command. Application frameworks can layer on top by passing their schedule + command through this surface; that's what shimkit framework laravel cron-install (v0.7.0) does.


Stats

  • Tests: 503 → 528 (+25)
  • Gates: pytest, ruff, mypy strict — all green
  • New optional extras: 0
  • Platform: macOS + Linux. Windows out of charter (Task Scheduler, not cron).

Upgrading

uv tool upgrade shimkit
pipx upgrade shimkit

No config changes required. New tools.cron block has sensible defaults; existing user configs continue to validate.