Create Transient Timers with systemd-run

systemd-run can wrap any command in a temporary timer/service unit — cron-like scheduling with no unit files to write.

LinuxschedulingsystemdtimersMedium risk
Run `sudo systemd-run --on-active=30min <command>` to run a command after 30 minutes, or `--on-calendar='Mon *-*-* 09:00:00'` for a recurring time.

01Command

Command
$ sudo systemd-run --on-active=30min apt-get update

02What it does

systemd-run creates transient units that live only in memory: with --on-active (a delay) or --on-calendar (a cron-style pattern) it generates a timer plus service pair automatically. The units get generated names like run-rabcdef.timer, so pass `--unit=myjob` to control the name and find them with `systemctl list-timers`. They vanish after running and on reboot, which makes this ideal for one-off delayed actions rather than permanent schedules.

03Risk

RiskMedium risk
Requirementssystemd-based distribution; transient units disappear after running or reboot (use --unit=NAME to give them a predictable name).
!Warning: Transient units are lost on reboot — persist anything recurring as a proper timer unit instead.

04Undo

Undo
$ systemctl stop run-<id>.timer run-<id>.service

05Sources

  • systemd-run(1) - run programs in transient units
    man7.org Linux man-pages · technical · 2026-09-17
    Evidence: --on-active= creates a transient timer unit which elapses after a relative timespan; --on-calendar= uses calendar event expressions; the command then runs in a transient service unit.

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions