~/sync-lab/mirror holds a copy of the source directory that nobody has updated for a while. A colleague asks you to update the copy with a single rsync command and check its settings.conf setting.
Update the copy with one command
In ~/sync-lab, update mirror from source with rsync, then look at the setting in the copy and compare the two settings.conf files in the ls -l output.
First, predict
What will cat mirror/settings.conf print after the sync?
Now start the exercise, run the command and compare your prediction with the output.
Why did rsync leave the old settings.conf in mirror?
-
data/orders.csvwas in mirror too, and rsync updated it:cat mirror/data/orders.csvprints1,42, as in source. -
The source comes first and the destination second:
source/→mirror/.cat source/settings.confstill printsmode=stable. -
The files in mirror belong to student, as
ls -lshows, and rsync overwroteorders.csvnext to it without errors.
rsync compared the size and modification time of the two settings.conf files, found them equal and skipped the file.