Linux Labs

Bash: text processing and scripts / Stage 8 of 9

A script on a schedule: environment, log, lock

Not running Starting usually ~20 s
Leave the lesson

Step 5 of 6 · on a machine · 3 min

A backup on the timer

Now fix lab-backup yourself. sudo systemctl start lab-backup.service, sudo journalctl -u lab-backup and the line with & from the previous step will help you check yourself. The lab-backup.timer file next to the service is explained in the systemd-timers article.

Exercise · do it

Put the backup on the timer reliably

In ~/sched-lab, make the lab-backup service save an archive to ~/sched-lab/archive, and make backup.sh, started while another copy is running — by the timer or by hand — exit at once with a nonzero status.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • The lab-backup service saves an archive not done yet
  • A second copy does not start work while the first is running not done yet

Step goals

0 of 2
  • The lab-backup service saves an archive — not done yet
  • A second copy does not start work while the first is running — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • The lab-backup service saves an archive — not done yet
  • A second copy does not start work while the first is running — not done yet
Loading…