Linux Labs

Packages, services, and logs / Stage 11 of 13

Cron jobs and systemd timers

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 8 · on a machine · 5 min

Enable the report timer

The machine has a ready pair of units, lab-report.timer and lab-report.service. The timer is disabled, and there is no report yet. The service writes the report as student into its home directory, so after the trigger you can read the file without sudo.

Exercise · do it

Start the report schedule

Enable lab-report.timer so that it runs now and after a reboot, and wait for it to fire: the service writes a report to ~/lab-schedule/report.txt. Do not change the units and do not start the service by hand.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Enable the timer now and at boot not done yet
  • Wait for it to fire and write the report not done yet

The timer keeps starting the service 10 seconds after each of its runs ends — that is what OnUnitInactiveSec=10s sets. Production timers fire less often, usually by OnCalendar.

Step goals

0 of 2
  • Enable the timer now and at boot — not done yet
  • Wait for it to fire and write the report — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Enable the timer now and at boot — not done yet
  • Wait for it to fire and write the report — not done yet
Loading…