Cron Scheduling

Use when scheduling recurring tasks or managing background services — crontab jobs, cron syntax, macOS launchd/launchctl services via lunchy-go, start/stop/restart services, recurring scripts.

aashutosh396 Updated

File contents

Cron & Service Scheduling

Schedule recurring commands with crontab and manage macOS launchd services with lunchy-go.

When to use

Setting up recurring jobs, running scripts on a schedule, starting/stopping/ restarting background services (redis, custom daemons).

crontab (cross-platform)

crontab -l    # List jobs
crontab -e    # Edit jobs

# Syntax: MIN HOUR DOM MON DOW command
# 0 9 * * *        daily at 9am
# */5 * * * *      every 5 minutes
# 30 8 * * 1-5     weekdays at 8:30am

lunchy-go (macOS launchctl wrapper)

lunchy-go ls [pattern]            # List services
lunchy-go start redis            # Start (pattern match ok)
lunchy-go stop redis             # Stop
lunchy-go restart redis          # Restart
lunchy-go status redis           # Status

Guidelines

  • Prefer lunchy-go for managing macOS launchd plists; crontab for simple jobs.
  • Always use full absolute paths inside cron jobs.
  • Redirect output to a log: command >> /tmp/job.log 2>&1.
  • Test the command manually before scheduling it.

aashutosh396/mindpalace commit 4bfba08961

Frequently asked questions

npx get-skill add aashutosh396/cron-scheduling