BM: Baca dalam Bahasa Melayu
World L4: Remote Kitchens
Copy files: scp and rsync
You will learn: to send files to a server, and to send only what changed.
Checked with Linux (Debian 13) on 1 Nov 2026
The problem
You changed one price on the menu. Only menu.html travelled. The other files stayed put. How did it know?
Try it
First the simple courier: scp copies over SSH, every time. Build “copy menu.txt to my home folder on kedai”.
Tap the pieces in the right order.
Watch
rsync: A smart courier. It compares both sides and carries only what changed. is a smart courier. It compares both sides first, then carries only what differs. -a keeps times and permissions. -v lists each file.
Predict
You leave out the slash: rsync -av site kedai:copy/. Then you list both folders on kedai. What did the slash change?
copy/site/menu.html
copy/site/index.html
shop/menu.html
shop/index.htmlPick one answer.
Try it
You want kedai’s shop folder to match your site folder exactly, extras removed. --delete can remove files there. Put the safe steps in order.
First step at the top. Put these in order. Use the arrows, or drag.
- rsync -av --delete --dry-run site/ kedai:shop/
- rsync -av --delete site/ kedai:shop/
- curl the page to check it
- Read the list: is every deleting line expected?
Watch
--dry-run says what would happen and changes nothing. Here: deleting old.html. Expected? Then run it for real.
Check
scp or rsync?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now send files to a server, and sync a folder safely.
Go deeper (optional)
Our practice server stands alone. These outputs came from two real Debian 13 machines. rsync must be on both machines: sudo apt install rsync. Copy back the other way with scp kedai:menu.txt . (the dot means here).
Real mission
scp notes.txt myvm:rsync -av --dry-run site/ myvm:site/rsync -av site/ myvm:site/
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
Anda ubah satu harga dalam menu. Hanya menu.html dihantar. Fail lain tak berganjak. Bagaimana ia tahu?
Mula-mula kurier biasa: scp salin melalui SSH, setiap kali. Bina “salin menu.txt ke folder rumah saya di kedai”.
rsync ialah kurier pintar. Ia bandingkan kedua-dua belah dahulu, kemudian bawa apa yang berbeza sahaja. -a kekalkan masa dan kebenaran. -v senaraikan setiap fail.
Tanpa garis condong: rsync -av site kedai:copy/. Ini isi kedua-dua folder di kedai. Apa bezanya?
copy/site/menu.html
copy/site/index.html
shop/menu.html
shop/index.html
Anda mahu folder shop di kedai sama betul dengan folder site anda, yang lebih dibuang. --delete boleh buang fail di sana. Susun langkah yang selamat.
--dry-run beritahu apa yang akan berlaku dan tak ubah apa-apa. Di sini: deleting old.html. Memang dijangka? Kemudian jalankan betul-betul.
scp atau rsync?
Kini anda boleh hantar fail ke server, dan selaraskan folder dengan selamat.
You finished this before. Practice is always welcome!
Official docs: OpenSSH: scp · Debian: rsync(1)
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?