- name
- cron-scheduler
- description
- Manage cron jobs on macOS/Linux - list, add, remove, backup, and schedule recurring tasks
- triggers
- commands
- list
- usage
- cron-scheduler list
- description
- List all cron jobs for current user
- add
- usage
- cron-scheduler add "<schedule>" "<command>
- description
- Add a new cron job with schedule validation
- remove
- usage
- cron-scheduler remove <line_number>
- description
- Remove a cron job by line number
- remove-pattern
- usage
- cron-scheduler removep <pattern>
- description
- Remove cron jobs matching a pattern
- edit
- usage
- cron-scheduler edit
- description
- Open crontab in default editor
- next
- usage
- cron-scheduler next
- description
- Show next run times for all jobs
- backup
- usage
- cron-scheduler backup
- description
- Backup current crontab to ~/.cron-backups/
- restore
- usage
- cron-scheduler restore [backup_file]
- description
- Restore crontab from backup (lists available if no file)
- service
- usage
- cron-scheduler service <start|stop|status>
- description
- Enable/disable or check cron service status
- templates
- usage
- cron-scheduler templates
- description
- Show common cron job schedule templates
Cron Scheduler Skill
A comprehensive skill for managing cron jobs on both macOS and Linux systems.
Features
- List Jobs - View all cron jobs for the current user
- Add Job - Create new cron jobs with schedule validation
- Remove Job - Delete jobs by line number or pattern
- Edit Crontab - Open crontab in your default editor
- Next Runs - See when each job will execute next
- Backup/Restore - Safely backup and restore crontab configurations
- Service Control - Start/stop/status of cron daemon
- Templates - Common schedule patterns for quick setup
Requirements
crontabcommand (pre-installed on macOS/Linux)bashshell- Optional:
cronnextfor accurate next-run predictions (Linux)
Installation
# Make the script executable
chmod +x ~/.openclaw/workspace/skills/cron-scheduler/scripts/cron-helper.sh
# Optional: Add to PATH
echo 'export PATH="$HOME/.openclaw/workspace/skills/cron-scheduler/scripts:$PATH"' >> ~/.zshrc
source ~/.zshrcUsage
List all cron jobs
cron-scheduler list
# or
cron-scheduler lAdd a new cron job
# Daily backup at 2am
cron-scheduler add "0 2 * * *" "~/scripts/backup.sh"
# Every hour
cron-scheduler add "0 * * * *" "~/scripts/hourly-task.sh"
# Every 5 minutes
cron-scheduler add "*/5 * * * *" "~/scripts/monitor.sh"Remove cron jobs
# By line number (use 'list' first to see line numbers)
cron-scheduler remove 3
# By pattern (matches anywhere in the line)
cron-scheduler removep "backup"Edit crontab directly
cron-scheduler edit
# or
cron-scheduler eShow next run times
cron-scheduler next
# or
cron-scheduler nBackup and restore
# Create backup
cron-scheduler backup
# List available backups
cron-scheduler restore
# Restore specific backup
cron-scheduler restore ~/.cron-backups/crontab_20240315_143022.bakManage cron service
# Check status
cron-scheduler service status
# Start cron (may require sudo)
cron-scheduler service start
# Stop cron (may require sudo)
cron-scheduler service stopView templates
cron-scheduler templates
# or
cron-scheduler tCron Schedule Format
┌──────────── minute (0 - 59)
│ ┌────────── hour (0 - 23)
│ │ ┌──────── day of month (1 - 31)
│ │ │ ┌------ month (1 - 12)
│ │ │ │ ┌---- day of week (0 - 6, Sunday=0)
* * * * *Common Examples
| Schedule | Description |
|---|---|
0 0 * * * | Daily at midnight |
0 2 * * * | Daily at 2am |
0 * * * * | Every hour |
*/5 * * * * | Every 5 minutes |
0 9 * * 1-5 | Weekdays at 9am |
0 0 * * 0 | Weekly on Sunday |
0 0 1 * * | Monthly on 1st |
Platform Support
- macOS: Uses
launchctlfor service management - Linux: Uses
systemctlfor service management
Safety Features
- Temporary files used for atomic crontab modifications
- Backup created before any destructive operations
- Confirmation prompt before restore
- Schedule validation before adding jobs