Windows – How to use rsync to reliably transfer permissions & ACLs when copying from NTFS internal C: to NTFS External disk

aclntfspermissionsrsyncwindows

What options of Rsync can I reliably use/ how/ combine to either:

  • RELIABLY TRANSFER "working" even if "limited set" of Permissions/ ACLs reliably & without conflict between the Gray area of Cygwin Windows/ NTFS & *Nix / Perms etc
    OR

  • Flush clean / have RSync totally avoid Permissions / ACL issues if I cant do the above?

I've read close to 50 tabs and windows on what to do around this from the last decade or so.

At how to deal with it seems to change based on where & who you are asking and what version of Rsync (time & variation/ alternative code base) is being talked about.

  • Rsync variations under Windows
    • (Several *Nix & Windows: Cygwin variations, CwRsync, Delta Copy/ Syncrify/ Synaman, GRsync, RsyncBackup, Rsync.exe pkg, Rclone, AcroSync, YInterSync)

Options to choose:

The answer on how to execute RSync for this specific scenario I've got from this QnA;

But after gathering all the "knowledge" on RSync around Cygwin, NTFS, Permissions & ACLs etc, I am not sure what variation does what to make a decision on how to proceed.

It turns out that to keep your Windows permissions in check, a simple chmod flag is required.
—chmod=ugo=rwX

Rsync Options (some..)

 -p, --perms                 preserve permissions
 -E, --executability         preserve the file's executability
     --chmod=CHMOD           affect file and/or directory permissions

 -A, --acls                  preserve ACLs (implies --perms)
 -o, --owner                 preserve owner (super-user only)
 -g, --group                 preserve group
     --devices               preserve device files (super-user only)
     --specials              preserve special files
 -D                          same as --devices --specials


/etc/fstab (addition of noacl)


# /etc/fstab
#
#    This file is read once by the first process in a Cygwin process tree.
#    To pick up changes, restart all Cygwin processes.  For a description
#    see https://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
# none /cygdrive cygdrive binary,posix=0,user 0 0
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0

Best Answer

I've been looking at this over the last several days, and after reading lots of references and actually trying out various combinations of flags, I don't think that rsync will carry Windows ACLs.

rsync -aX src/ dst/
rsync: extended attributes are not supported on this client

I found this recommendation to remount the Cygwin view of the local NTFS drives with noacl, but I couldn't get that to work usefully for me. Another suggestion to use --chmod=ugo=rwX didn't help at all.

It seems that for this particular use case you'll need to use something like ROBOCOPY /SEC instead of rsync.

Related Question