Back Up the Website
You keep the website in site and back it up to backup. Use rsync to make the first backup, update it after a change, and then mirror a deletion, safely.
How it works: the terminal below is a real Linux machine running in your browser. Click it and
type. Tasks tick themselves off as you complete them; questions are answered in the box under each task.
Press Reset any time for a fresh machine. Your password on this machine (for
sudo) is student.
Hints
The trailing slash on the source decides whether you copy the folder or its contents.
Always dry-run --delete with -n first.
Solution explanation
rsync -av site/ backup/ copies the contents of site (the trailing slash) into backup. Run again, it transfers only the file you changed. --delete makes the backup an exact mirror, removing files that are gone from the source; the -n dry run shows what that would do before you commit to it.
Show solution
rsync -av site/ backup/
echo '<h1>Updated</h1>' >> site/index.html
rsync -av site/ backup/
rm site/style.css
rsync -avn --delete site/ backup/
rsync -av --delete site/ backup/
ls backup