System Management
An administrator must mirror /var/www to /srv/backup/www on the host bk01 over SSH. The copy must preserve permissions, ownership and timestamps, remove files from the backup that were deleted from the source, and place the contents directly in /srv/backup/www rather than in a nested www directory. Which command does this?
Show the answer
Correct answerB. rsync -a --delete /var/www/ backup@bk01:/srv/backup/www/
Archive mode keeps permissions, ownership and timestamps, --delete removes files that no longer exist at the source, and the trailing slash on the source copies its contents rather than the directory itself. Omitting the trailing slash would create /srv/backup/www/www, which is the most tempting mistake.