Using tmux and Cron for Scheduled AI Agent Management
Using tmux and Cron for Scheduled AI Agent Management
Most agent orchestration frameworks are overbuilt. If you need multiple AI agents running on a schedule - one checking emails, one monitoring logs, one processing data - you do not need Kubernetes or a custom scheduler. You need tmux and cron.
One Pane Per Agent
The setup is simple. Create a tmux session with named windows, one per agent. Each agent runs in isolation with its own scrollback buffer, its own environment variables, and its own log output. When something breaks, you attach to that pane and see exactly what happened.
tmux new-session -d -s agents
tmux new-window -t agents -n "email-agent"
tmux new-window -t agents -n "log-monitor"
tmux new-window -t agents -n "data-processor"
Cron as the Scheduler
Add crontab entries that send commands to specific tmux panes. Every 15 minutes, fire off the email agent. Every hour, run the log analyzer. The agent runs, completes, and the pane stays open so you can review output later.
*/15 * * * * tmux send-keys -t agents:email-agent "python email_agent.py" Enter
0 * * * * tmux send-keys -t agents:log-monitor "python log_monitor.py" Enter
Why This Beats Complex Orchestrators
- Visibility - attach to any pane and see real-time output
- Isolation - one crashing agent does not take down others
- Simplicity - no Docker, no framework dependencies, no YAML configs
- Debugging - scroll up in the pane to see the full history
The main limitation is that this is single-machine. If you need distributed agents across multiple hosts, you will outgrow this pattern. But for a solo developer running five to ten agents on a Mac Mini, tmux plus cron handles 90% of use cases without any infrastructure overhead.
The best orchestration system is the one you can debug in 30 seconds by attaching to a terminal.
Fazm is an open source macOS AI agent. Open source on GitHub.