CompTIA Linux+ (XK0-004) — Question 299

A Linux administrator needs to copy the log files and all the subdirectories in /var/log/archive to the /log/backups/ directory on a remote server at backup.example.com. The administrator will use the archive user account to access the remote server.
Which of the following commands will do this?

Answer options

Correct answer: A

Explanation

The command in option A is correct as it properly uses the scp command with the -r flag to recursively copy the contents of /var/log/archive to the specified directory on the remote server, authenticating with the archive user. Option B is incorrect because it does not specify the user account. Option C fails to copy subdirectories since it only targets files in the directory. Option D incorrectly attempts to copy from the remote server to the local directory.