C Cron

Manage cron jobs and macOS launchctl services — schedule recurring tasks, start/stop services using lunchy-go.

daxaur 4669c1e 1.1 KB Updated

File contents

Scheduling & Cron

lunchy-go (launchctl wrapper)

Friendly wrapper around macOS launchctl:

# List all services (pattern match)
lunchy-go ls
lunchy-go ls redis

# Start a service
lunchy-go start com.example.service
lunchy-go start redis    # pattern match

# Stop a service
lunchy-go stop redis

# Restart a service
lunchy-go restart redis

# Show service status
lunchy-go status redis

crontab (built-in)

Standard Unix cron scheduler:

# List current cron jobs
crontab -l

# Edit cron jobs (opens editor)
crontab -e

# Cron syntax: MIN HOUR DOM MON DOW command
# Every day at 9am:
# 0 9 * * * /path/to/script.sh
# Every 5 minutes:
# */5 * * * * /path/to/script.sh
# Weekdays at 8:30am:
# 30 8 * * 1-5 /path/to/script.sh

Guidelines

  • Prefer lunchy-go for macOS services (launchd plists)
  • Use crontab for simple recurring commands
  • Always use full paths in cron jobs
  • Redirect output to log files: command >> /tmp/cron.log 2>&1
  • Test commands manually before scheduling them

daxaur/openpaw/tree/main/skills/c-cron commit 4669c1ea72

Frequently asked questions

npx skillmds@latest add daxaur/c-cron