A system administrator wants to perform a directory synchronization from a local folder to a remote backup server. The requirement is to ensure that only the differences since the last sync are transferred to minimize network usage. The sync needs to be recursive to include all subdirectories and also preserve file permissions. Which command accomplishes this goal most efficiently?
The correct answer is rsync -a /local/directory user@remote:/backup/directory because the -a (archive) flag is used to preserve permissions, timestamps, ownership, and to ensure recursive copying — while also optimizing by transferring only the differences from the last sync. The --dry-run flag would only simulate the transfer without actually copying files, --update will skip files newer on the receiver without considering other changes, and --in-place could potentially reduce transfer efficiency as it updates destination files in place - useful for large, single files but not necessarily for directory syncs with minimal changes.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'rsync -a' command do?
Open an interactive chat with Bash
How does rsync determine the differences between the source and destination?
Open an interactive chat with Bash
What are file permissions and why are they important when syncing?