World map

 

BM: Baca dalam Bahasa Melayu

World L4: Remote Kitchens · Boss challenge

Fix the nightly backup

You will learn: to turn a backup that fails quietly into one that is loud, correct and on the roster.

Checked with Linux (Debian 13) on 1 Nov 2026

The problem

You are you in /home/you. 3 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • backup.sh (file)-rwxr-xr-xcan run
  • backups/ (folder)drwxrwxr-x
  • kedai/ (folder)drwxrwxr-xmenu

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Boss! The backup said backup done every night. Today the menu broke, and you need yesterday’s copy. The backups folder is empty!

Check

It printed an error, then backup done, and exit code 0. Why did it look fine?

Pick one answer.

Try it

Stage 1: make it loud. Turn on strict mode (line 3), then run it. It should fail, out loud.

You are you in /home/you. 3 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • backup.sh (file)-rwxr-xr-xcan run
  • backups/ (folder)drwxrwxr-x
  • kedai/ (folder)drwxrwxr-xmenu

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Watch

The real error says cp: cannot create directory '/home/you/backup/menu-2026-11-01': No such file or directory. Tap the line with the wrong folder.

Tap the line with the wrong folder.

0 of 1 found

Try it

Stage 2: fix the folder name, then run it. A dated copy should land in backups.

You are you in /home/you. 3 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • backup.sh (file)-rwxr-xr-xcan run
  • backups/ (folder)drwxrwxr-x
  • kedai/ (folder)drwxrwxr-xmenu

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Predict

Stage 3 needs a roster line for 2 a.m., every night. Which one?

Pick one answer.

Try it

Stage 3: put it on the roster for 2 a.m. Bonus: keep its words in a log with >> /home/you/backup.log 2>&1.

You are you in /home/you. 3 things here. Services: cron running, ssh running, nginx running.

You are hereyou@kedai:~$

Folder ~

  • backup.sh (file)-rwxr-xr-xcan run
  • backups/ (folder)drwxrwxr-x
  • kedai/ (folder)drwxrwxr-xmenu

+ 3 hidden (ls -a)

Services

  • cronrunningstarts at boot
  • sshrunningstarts at boot
  • nginxrunningstarts at boot

Check

Lessons from the night. Good rule or not?

Swipe right for good, left for needs work. Or use the buttons.

1 / 3

A loud failure beats a quiet one.

A loud failure beats a quiet one.

You did it!

You can now make a backup script loud, correct and scheduled.

Go deeper (optional)

A systemd timer is the other way to schedule it (lesson 5). Its failures show in systemctl status and journalctl. Many teams also send an alert when a backup fails. The Monitoring & Observability course shows how.

Real mission

  1. ./backup.sh; echo $?

0 of 4 steps done · Your ticks are saved.