nerdexam
CompTIA

XK0-005 · Question #645

An administrator would like to mirror the website files on the primary web server www1, to the backup web server www2. Which of the following commands should the administrator use to most…

The correct answer is A. [www1] $ rsync -a -e ssh /var/www/html user1@www2:/var/www/html. rsync is the most efficient tool for mirroring because it uses a delta-transfer algorithm - it only sends the differences between source and destination, rather than re-copying all files every time. The command 'rsync -a -e ssh /var/www/html user1@www2:/var/www/html' uses -a…

System Management

Question

An administrator would like to mirror the website files on the primary web server www1, to the backup web server www2. Which of the following commands should the administrator use to most efficiently accomplish this task?

Options

  • A[www1] $ rsync -a -e ssh /var/www/html user1@www2:/var/www/html
  • B[www1] $ scp -r /var/www/html user1@www2:/var/www/html
  • D[www1] $ cd /var/www/html && tar cvf - . | ssh user1@www2 ' (cd/var/www/html; tar xvf -)'

How the community answered

(21 responses)
  • A
    71% (15)
  • B
    19% (4)
  • D
    10% (2)

Explanation

rsync is the most efficient tool for mirroring because it uses a delta-transfer algorithm - it only sends the differences between source and destination, rather than re-copying all files every time. The command 'rsync -a -e ssh /var/www/html user1@www2:/var/www/html' uses -a (archive mode, preserving permissions, timestamps, symlinks, etc.) and -e ssh (encrypts the transfer over SSH). Option B (scp -r) copies all files every time with no delta comparison, making it far less efficient for repeated syncing. Option D (tar over SSH) is functional but also transfers all data every time without delta optimization.

Topics

#rsync#File Synchronization#Remote Copy#Linux Commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice