# [Samba] Robocopy, archive bit and ACLs

Jeremy Allison jra at samba.org
Tue Dec 11 22:00:19 UTC 2018

On Sat, Dec 08, 2018 at 09:35:33PM -0500, Jerome Charaoui via samba wrote:
> Hello,
>
> I'm attempting to set up a daily Robocopy task on a Windows Server 2016
> to duplicate a large directory tree -- including data, timestamps and
> ACLs -- to a Samba 4.5.12 server.
>
> This is my Robocopy command:
> Robocopy.exe C:\source \\foo\bar /XA:SH /XJ /MIR /NODCOPY /COPY:DTSO
> /A+:A /ZB
>
> I noticed that for a significant number of files, Robocopy will
> systematically identify them as modified even though no aspect of them
> will have changed in any way.
>
> After much trial and error, I tracked the cause down to the archive bit.
> If the archive bit is set the same way on the source and destination
> (either both on or both off), Robocopy will detect the file as
> "Modified" and count it toward "Copied" files. If the bit differs,
> regardless of which way, this does not happen. I also noticed that if I
> remove both "SO" flags from the /COPY: argument, the issue goes away.

The 'A' bit is set whenever a file has been modified,
meaning it needs backing up.

So I'm guessing if Robocopy sees the 'A' bit on a source
file it knows it should back it up. If the 'A' bit differs
then I'm assuming that Robocopy just thinks that means the
file metadata is different and should also copy.