Interactive CLI to schedule any shell command into a running tmux session at a future time, powered by
at.
Pick a tmux session, type the command, choose when — done. The command is delivered to that session at the scheduled time as if you typed it yourself.
You want a long-running command to fire later (a backup at 3 AM, a deploy at 14:00, a git pull "in 30 minutes") inside a specific tmux session so the output stays attached, scrollable, and visible. cron and at alone don't talk to tmux. tmux-timer glues them together with an interactive prompt.
- 🖥️ Lists all active tmux sessions and lets you pick one
- ⏰ Five scheduling modes: today, tomorrow, specific date, weekday, or relative (
now + 30 minutes) - 👤 sudo-aware — schedules under the invoking user, not root
- 🔍 Confirmation step shows the parsed execution time before queueing
- 🧹 Self-cleaning temp scripts in
/tmp - 📋 Manage queued jobs with standard
atq/atrm
| Tool | Purpose |
|---|---|
bash |
shell |
tmux |
target sessions |
at + atd |
scheduling backend |
install.sh will install any missing dependencies for you and enable the atd service. Supported package managers: apt, dnf, yum, pacman, zypper, apk, brew.
git clone https://github.com/hehljo/tmux-timer.git && cd tmux-timer && sudo ./install.shThis will:
- Detect your package manager and install
atandtmuxif missing. - Enable and start the
atdservice. - Deploy
timer.shto/usr/local/bin/timer.
If you've already got at and tmux set up — or want to manage them yourself:
sudo ./install.sh --no-depsgit clone https://github.com/hehljo/tmux-timer.git
cd tmux-timer
sudo install -m 0755 timer.sh /usr/local/bin/timersudo rm /usr/local/bin/timertimerYou'll be walked through:
- Session — pick from your active tmux sessions
- Command — what to run (e.g.
git pull && npm run build) - When — today / tomorrow /
DD.MM.YYYY/ weekday name / relative - Time —
HH:MM(skipped in relative mode) - Confirm — review and queue the job
$ timer
=== TMUX Timer Scheduler ===
Verfügbare tmux Sessions:
[1] dev: 3 windows (created Mon Apr 21 09:14:02 2026)
[2] backup: 1 windows (created Mon Apr 21 10:02:11 2026)
Wähle Session (Nummer): 2
Befehl der ausgeführt werden soll: rsync -av /data/ /backup/
=== Wann soll der Befehl ausgeführt werden? ===
[1] Heute [2] Morgen [3] Datum [4] Wochentag [5] Relativ
Wähle Option (1-5): 1
Uhrzeit (HH:MM): 03:00
✓ Timer erfolgreich erstellt!
atq # list pending jobs
atrm <job-number> # cancel a job
at -c <job-number> # show what a queued job will run- You answer the prompts. The script writes a one-shot helper into
/tmp/tmux_timer.XXXXXX.sh. - The helper is queued via
atto run at the chosen time. - When
atfires, the helper runstmux send-keysagainst your chosen session — first the command text, thenEnter— then deletes itself.
When invoked with sudo, the helper is chowned to $SUDO_USER and queued under that user, so it sees the right tmux server.
- Linux only. Requires
at/atd. macOS hasatrundisabled by default. - Interactive only. Prompts cannot be piped; the script is meant to be driven by a human.
- Survives only as long as the target tmux session does. If the session is killed before fire time, the command will fail silently.
Issues and PRs welcome. Keep the script POSIX-friendly bash and preserve the German user-facing strings (or add i18n).