[Samba] File attributes issue

Anders Östling
Thu, 03 Oct 2024 15:48:05 -0000

HiWe have two Windows servers (one active, one standby) that we keep in sync by
using ROBOCOPY to do a differential copy every night. The options make sure that
only new or altered files are transferred, and deleted ?master? files also is
deleted on the standby server.

Now I want to relocate a couple of shares from the active server to a Samba 4.20
server. The shares are up and working as they should, including all ACL?s and
security information. The issue is that every file is copied every night and not
just the changed/created/deleted ones as in the Windows->Windows case. I
guess it depends on that the archive flag is not properly set on the Samba side,
but that is only my uneducated guess. How do I verify this?

The Robocopy command and switches are as follows

NET USE X: \\HP-DOCSRV\DOKUMENT
ROBOCOPY D:\DOKUMENT X:\ /NFL /NDL /MIR /NP /UNILOG+:D:\DOKUMENT.LOG /COPY:DATSO
/FFT /R:5
NET USE X: /DEL /Y

The log from the Win->Win run shows 95 directories and 1243 files copied
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :      5621        95      5526         0         0         0
   Files :     54888      1243     53645         0         0         7
   Bytes :  20.645 g  499.86 m  20.157 g         0         0   20.29 m
   Times :   0:02:23   0:01:29                       0:00:00   0:00:53

The log from the Win->Samba run, directly following the Win->Win sync
shows 104 directories and 52000 files copied. In my world they should be
identical.
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :      5621       104      5517         0         0         6
   Files :     54888     52033      2855         0         0        19
   Bytes :  20.645 g  19.767 g  899.69 m         0         0   21.91 m
   Times :   0:10:00   0:07:29                       0:00:00   0:02:30

The Samba settings are

[global]
bind interfaces only = Yes
client min protocol = SMB2
dedicated keytab file = /etc/krb5.keytab
interfaces = lo enp1s0
kerberos method = secrets and keytab
log file = /var/log/samba/%m.log
min domain uid = 0
realm = XXXXXXXX
security = ADS
server role = member server
username map = /etc/samba/user.map
winbind enum groups = Yes
winbind enum users = Yes
winbind refresh tickets = Yes
workgroup = HPLTS
idmap config hplts : range = 10000-999999
idmap config hplts : backend = rid
idmap config * : range = 3000-7999
acl_xattr:ignore system acls = yes
idmap config * : backend = tdb
mangled names = no
map acl inherit = Yes
vfs objects = acl_xattr


[dokument]
path = /data/DOKUMENT
read only = No