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 7 of 8 · lab · 15 mineasy

Cron job isn't running

A job in root's schedule should mark a file every minute, but the file never appears. Find out why and make cron write it.

Situation

root's schedule has a job: run /usr/local/bin/backup.sh every minute. The script writes the time of its run to /var/backups/heartbeat — that mark shows the job is alive. The mark has never appeared, and nobody has seen any error on screen.

Task

  1. The /usr/local/bin/backup.sh job stays in root's schedule.
  2. cron runs it itself: /var/backups/heartbeat is written when the job runs on schedule. Running the script by hand does not count.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 2
  • The /usr/local/bin/backup.sh job is still in root's schedule — not done yet
  • cron runs the job itself — /var/backups/heartbeat is written when it runs — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 2
  • The /usr/local/bin/backup.sh job is still in root's schedule — not done yet
  • cron runs the job itself — /var/backups/heartbeat is written when it runs — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 2
  • The /usr/local/bin/backup.sh job is still in root's schedule — not done yet
  • cron runs the job itself — /var/backups/heartbeat is written when it runs — not done yet
Loading…