Soru

Zorluk: ZorMicrosoft Command-Line Tools

A system administrator needs to copy a sensitive directory structure from C:\FinanceData to E:\FinanceBackup using the Windows Command Prompt. The transfer must include all subdirectories—even if they are empty—and preserve all file attributes, NTFS access permissions, owner information, and auditing flags. Additionally, existing destination files that do not exist in the source directory must remain intact and not be deleted. Which command should the administrator execute?

  1. robocopy C:\FinanceData E:\FinanceBackup /e /copyallCevap
  2. B
    robocopy C:\FinanceData E:\FinanceBackup /s /copyall
  3. C
    robocopy C:\FinanceData E:\FinanceBackup /e /mir
  4. D
    rsync -a --owner --group C:\FinanceData E:\FinanceBackup

Cevap

The command `robocopy C:\FinanceData E:\FinanceBackup /e /copyall` is correct because `/e` includes empty subdirectories and `/copyall` preserves all NTFS permissions, ownership, attributes, and auditing settings without deleting extra destination files.
The command `robocopy C:\FinanceData E:\FinanceBackup /e /copyall` satisfies all criteria. The `/e` switch ensures all subdirectories, including empty ones, are copied. The `/copyall` flag is a shorthand for `/copy:DATSOU`, which preserves Data, Attributes, Timestamps, NTFS Security (ACLs), Owner information, and Auditing flags. Because `/mir` is omitted, no destination files will be purged.

Adım Adım Çözüm

1
Identify the required utility for robust file and attribute copying in Windows CLI.
Robocopy (Robust File Copy) is the standard Windows command-line utility for advanced file migration.
Standard copy/xcopy commands do not easily preserve full NTFS auditing and ownership information in a single switch.
2
Determine the sub-directory copying requirement flag.
The `/e` flag copies all subdirectories, including empty ones (unlike `/s` which excludes empty directories).
The scenario explicitly specifies that empty subdirectories must be included.
3
Determine the security and attribute preservation flag.
The `/copyall` flag is equivalent to `/copy:DATSOU` (Data, Attributes, Timestamps, Security/ACLs, Owner, Auditing).
Full audit logs, ownership, and NTFS permissions are explicitly required.
4
Ensure destination file deletion behavior is controlled.
Do not use `/mir` because `/mir` (mirror) will purge existing files in the destination folder that are absent from the source.
The requirement states that existing files in the destination folder must not be deleted.

Anahtar Kavram

Microsoft Windows Robocopy Utility Switches
Bu soruyu puanla