linux-cron-manager

Generate Linux cron entries with locking, logging, and failure alerts.

3|1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/chfle/lehnert-claude-skills --skill linux-cron-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: linux-cron-manager
Source: https://github.com/chfle/lehnert-claude-skills/tree/main/skills/linux-cron-manager
Command: npx skills add https://github.com/chfle/lehnert-claude-skills --skill linux-cron-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scheduling Linux tasks reliably can be error-prone without proper locking, environment handling, and standardized cron formatting. This Skill automates the creation of /etc/cron.d entries and production-ready wrapper scripts to ensure safe, auditable, and retry-capable cron jobs.

Core Features & Use Cases

  • Cron entry generation: Produce /etc/cron.d files with proper headers (SHELL, PATH, MAILTO) and user ownership.
  • Wrapper with locking & logging: Converges on flock-based locking, timestamped logs, log rotation, and failure trapping.
  • Systemd timer conversion: Provide guidance or outputs to convert cron jobs to systemd timers when needed.
  • Debug & validation: Debug cron behavior, environment differences, and provide testing steps.

Quick Start

Create a new cron job by specifying the schedule and command, and place the wrapper script alongside the cron file.

Frequently Asked Questions about linux-cron-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent overlapping cron jobs in Linux?

Prevent overlapping cron jobs by applying flock-based locking within a wrapper script. This ensures deterministic execution by blocking subsequent runs until the previous process releases the lock, preventing duplicate or competing tasks.

What's the best way to generate /etc/cron.d files with proper environment setup?

Generate /etc/cron.d files by defining standard headers like SHELL, PATH, and MAILTO alongside user ownership. This ensures strict formatting compliance and correct environment variable handling for scheduled tasks.

How do I add logging and failure alerts to a Linux cron job?

Add logging and failure alerts to cron jobs by trapping errors within a wrapper script that produces timestamped logs. The wrapper handles log rotation and triggers alerts when scheduled commands fail.

Can I convert cron jobs to systemd timers?

Yes, you can convert cron jobs to systemd timers when systemd timers are preferred. This provides an alternative scheduling mechanism with native logging and dependency management for recurring server tasks.

Why does my cron job fail due to environment differences?

Cron jobs fail due to environment differences because the cron daemon uses a minimal shell environment. Resolve this by explicitly setting PATH and required variables in the /etc/cron.d file or wrapper script headers.

How do I debug and validate Linux cron behavior?

Debug and validate cron behavior by testing the wrapper script manually in a clean environment, checking timestamped logs for execution records, and verifying flock locking to ensure the scheduled task runs correctly.