XK0-005 · Question #249
A Linux administrator needs to back up files from a user's home directory to a remote server. The administrator copied the files last week but must ensure any files created or modified since then…
The correct answer is B. rsync -r /home/user99 [email protected]:/backups. To efficiently back up only new or modified files from a local directory to a remote server, rsync is the most suitable command due to its incremental transfer capabilities.
Question
A Linux administrator needs to back up files from a user's home directory to a remote server. The administrator copied the files last week but must ensure any files created or modified since then are added. Which of the following is the BEST command for the administrator to use?
Options
- Ascp -r /home/user99/* [email protected]:/backups/user99/
- Brsync -r /home/user99 [email protected]:/backups
- Ccp -rf /home/user99/* /mnt/backups/user99/
- Dsftp -b /home/user99/* [email protected]:/backups
How the community answered
(30 responses)- A20% (6)
- B70% (21)
- C7% (2)
- D3% (1)
Why each option
To efficiently back up only new or modified files from a local directory to a remote server, `rsync` is the most suitable command due to its incremental transfer capabilities.
`scp -r` performs a full recursive copy of all files and directories every time, making it inefficient for incremental backups as it re-copies unchanged files.
`rsync -r /home/user99 [email protected]:/backups` utilizes `rsync` with the recursive option (`-r`) to synchronize the local directory `/home/user99` to the remote destination. `rsync` intelligently compares files by modification time and size, transferring only those that are new or have changed, making it perfect for incremental backups.
`cp -rf` copies files locally and does not support remote transfers, nor does it inherently perform incremental synchronization.
`sftp` is an interactive file transfer program or can be scripted, but it lacks the built-in differential syncing algorithm that `rsync` uses for efficient incremental backups.
Concept tested: Incremental remote backups with rsync
Source: https://manpages.debian.org/stable/rsync/rsync.1.en.html
Topics
Community Discussion
No community discussion yet for this question.