Which switch in RSYNC allows you to recursively back up a directory tree and preserve file metadata?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The switch that allows you to recursively back up a directory tree and preserve file metadata in RSYNC is the -a option. The -a switch stands for "archive" and is a combination of several options that are often used together for backups.

By using the -a option, RSYNC will not only navigate through all directories and subdirectories (recursion) but also preserve important file attributes such as permissions, timestamps, symbolic links, and ownership information. This ensures that the backup maintains the original structure and characteristics of the files and directories, making it suitable for a comprehensive backup operation.

In contrast, the -r switch would also allow for recursion but does not preserve all of the metadata, making it less comprehensive for backup purposes. The -z option is used for compression during transfer, which can speed up the process over networks but does not relate to preservation of metadata or recursion. The -p option, on its own, is focused on preserving permissions but does not include the full range of metadata and recursive functionality that the -a option provides. Thus, the -a option is the most suitable choice for a complete and effective backup of a directory tree along with its metadata.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy