CompTIA Linux+ (XK0-005) — Question 13
A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?
Answer options
- A. scp -p /data remote:/backup/data
- B. ssh -i /remote:/backup/ /data
- C. rsync -a /data remote:/backup/
- D. cp -r /data /remote/backup/
Correct answer: C
Explanation
The correct command is C, as 'rsync -a' is specifically designed for efficiently transferring and synchronizing files and directories to a remote location, preserving permissions and attributes. Option A uses 'scp' which does not support incremental transfers and will not preserve attributes as effectively. Option B is incorrect as 'ssh' is not a file transfer command, and option D is wrong because 'cp' cannot be used to copy files to a remote server.