From cron-scheduling
Schedule and manage recurring tasks with cron and systemd timers. Use when creating cron jobs, systemd timers, debugging why a scheduled job didn't run, handling timezones, or monitoring job failures.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cron-scheduling:cron-schedulingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```
┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * * command
* * * * * # Every minute
*/5 * * * * # Every 5 minutes
0 * * * * # Every hour at :00
30 2 * * * # Every day at 2:30 AM
0 9 * * 1 # Every Monday at 9:00 AM
0 0 1 * * # First day of every month at midnight
0 3 * * 0 # Every Sunday at 3 AM
@reboot # Run once at startup
@daily # 0 0 * * *
@hourly # 0 * * * *
crontab -e # Edit crontab
crontab -l # List crontab
sudo crontab -u www-data -e
crontab -l > crontab-backup-$(date +%Y%m%d).txt
PATH=/usr/local/bin:/usr/bin:/bin
[email protected]
0 2 * * * /opt/scripts/backup.sh >> /var/log/backup.log 2>&1
*/5 * * * * /opt/scripts/healthcheck.sh || /opt/scripts/alert.sh "Health check failed"
* * * * * flock -n /tmp/myjob.lock /opt/scripts/slow-job.sh
# /etc/systemd/system/backup.service
[Unit]
Description=Daily backup
[Service]
Type=oneshot
ExecStart=/opt/scripts/backup.sh
User=backup
StandardOutput=journal
StandardError=journal
# /etc/systemd/system/backup.timer
[Unit]
Description=Run backup daily at 2 AM
[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true
RandomizedDelaySec=300
[Install]
WantedBy=timers.target
sudo systemctl daemon-reload
sudo systemctl enable --now backup.timer
systemctl list-timers
systemctl list-timers --all
systemctl status backup.service
journalctl -u backup.service --since today
sudo systemctl start backup.service # run manually
sudo systemctl disable --now backup.timer
OnCalendar=daily
OnCalendar=Mon *-*-* 09:00:00
OnCalendar=Mon..Fri *-*-* 08:00:00
OnCalendar=*-*-01 00:00:00 # Monthly
OnCalendar=0/6:00:00 # Every 6 hours
systemd-analyze calendar "Mon *-*-* 09:00:00"
systemd-analyze calendar --iterations=5 "Mon..Fri *-*-* 08:00:00"
systemctl status cron
grep CRON /var/log/syslog
journalctl -u cron --since today
# Test with cron's minimal environment:
env -i HOME=$HOME SHELL=/bin/sh PATH=/usr/bin:/bin /opt/scripts/backup.sh
#!/bin/bash
set -euo pipefail
JOB_NAME="${1:?Usage: cron-wrapper.sh <job-name> <command> [args...]}"
shift
LOG_DIR="/var/log/cron-jobs"
mkdir -p "$LOG_DIR"
LOG_FILE="$LOG_DIR/$JOB_NAME.log"
log() { echo "[$(date -u '+%Y-%m-%dT%H:%M:%SZ')] $*" >> "$LOG_FILE"; }
log "START: $*"
START_TIME=$(date +%s)
if "$@" >> "$LOG_FILE" 2>&1; then
log "SUCCESS ($(( $(date +%s) - START_TIME ))s)"
else
EXIT_CODE=$?
log "FAILED with exit code $EXIT_CODE"
exit $EXIT_CODE
fi
>> /var/log/job.log 2>&1env -i to simulate cron's minimal environmentflock to prevent overlapping runssystemd-analyze calendar to verify timer schedulesnpx claudepluginhub billyfranklim1/claude-skills --plugin cron-schedulingBuilds production-grade scheduled jobs with cron syntax, overlap prevention, monitoring, and structured logging. Activates when users mention cron jobs, scheduled tasks, or recurring jobs.
Schedules Claude Code tasks via native OS schedulers (launchd, crontab, Task Scheduler) from natural language. Handles one-time/recurring jobs with git worktree isolation.