A tmux-based cron scheduler that runs your scheduled tasks in organized tmux panes, making them visible and interactive.
tmux-cron is an alternative to traditional cron that runs scheduled jobs inside a tmux session. Each job runs in its own pane, organized by frequency (startup, daily/hourly, weekly, monthly+). This makes it easy to see what's running, check logs, and interact with your scheduled tasks.
Jobs are automatically launched at system startup via a macOS LaunchAgent.
Modern macOS versions restrict cron from running scripts due to privacy and security policies, resulting in errors like:
bash: /Users/me/some/where/script.sh: Operation not permitted
By running jobs through a LaunchAgent instead of cron, tmux-cron bypasses these restrictions while providing better visibility and control over your scheduled tasks.
- Visual scheduling: All cron jobs visible in organized tmux panes
- Frequency-based organization: Jobs grouped by how often they run (startup, daily/hourly, weekly, monthly+)
- Auto-launch at startup: Runs via macOS LaunchAgent
- Standard cron syntax: Use familiar cron expressions and
@reboot,@hourly, etc. - Environment variable support: Define
ENV=valuein your crontab
brew install netj/tap/tmux-cron
brew services start tmux-cronPrerequisites: macOS, uv, tmux, Homebrew
./Install.tmux-cron.toolThis will:
- Install
tmux-cronto~/.local/bin/tmux-cron - Set up a LaunchAgent to auto-start at login
- Configure PATH via
/etc/paths.d/for Homebrew
The easiest way to migrate your existing crontab to tmux-cron:
tmux-cron --migrate-from-crontabIf you prefer to edit while migrating:
crontab -l | pbcopy
tmux-cron -e # :r!pbpaste in vim
crontab -rtmux-cron -eOpens your crontab in $EDITOR (defaults to nano). Example crontab:
# Environment variables
MAILTO=you@example.com # XXX email from chatty jobs not supported yet
# Run at startup
@reboot echo 'Mac Started'
# Run every 5 minutes
*/5 * * * * /path/to/frequent-task.sh
# Run weekly on Sunday
0 0 * * 0 /path/to/weekly-backup.sh
# Standard cron syntax also works
0 9 * * 1-5 /path/to/weekday-morning.shtmux-cron -ltmux-cron -a
# or just:
tmux-crontmux-cron --migrate-from-crontabJobs are organized into tmux windows by frequency:
- startup:
@rebootjobs - daily-hourly: Frequent jobs (≤ daily)
- weekly: Occasional jobs (weekly range)
- monthly-plus: Rare jobs (monthly or less frequent)
- misc: Jobs that don't fit other categories
- Crontab:
~/.tmux-cron/crontab - Session config:
~/.tmux-cron/session.yaml - Environment bridge:
~/.tmux-cron/bridge.sh - LaunchAgent:
~/Library/LaunchAgents/io.github.netj.tmux-cron.plist
How it works
< 5D60 a id="user-content-how-it-works" class="anchor" aria-label="Permalink: How it works" href="#how-it-works">- You edit
~/.tmux-cron/crontabusing standard cron syntax - tmux-cron parses the crontab and generates a tmuxp YAML configuration
- Each job runs in its own pane using croniter for scheduling
- The LaunchAgent ensures the tmux session starts at login
MAILTO=and emailing the stdout/stderr from jobs to the user is not supported yet.
MIT