But it gets even more fine-tuned than that. You can target specific file attributes for inclusion or exclusion. This is carried out with the option /COPY:copyflag[s]. Robocopy uses the command /COPY:DAT as a default to backing up file contents (D = data), attributes like read-only or hidden (A = attributes), and the time stamp (T = timestamp). The timestamp contains information about the date of creation, date modified, and the date last opened. This information is essential for incremental backups since they should only apply to recently changed files and directories. Another parameter is S (= security), which transfers NTFS access rights.
Excluding individual copy flags can help, for example, when certain security rights aren’t correctly set in the target system, leading to failed or incomplete copy operations. In this case, you can refrain from using the S copy flag. Including flag A can, for example, copy read-only attributes onto the backup copies. If you want to transfer file contents, attributes, and the time stamp, the code will look as follows: