/ Published in: Bash

Cygwin's `cp` discards ACLs (complex windoze permissions). You have to copy them separately as follows:
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# First copy files themselves, with timestamps: cp -a folder1 folder2 # Set all ACLs of copies to ACLs of originals: cd folder2 find . | while read f ; do getfacl ../folder1/"$f" | setfacl -f - "$f" ; done # or when permissions are equal for all files / directories: getfacl folder1 > folder-perms getfacl folder1/file > file-perms find folder2 -type d -exec setfacl -f folder-perms '{}' \; find folder2 -type f -exec setfacl -f file-perms '{}' \; # or probably faster: find folder2 -type d -print0 | xargs -0 setfacl -f folder-perms find folder2 -type f -print0 | xargs -0 setfacl -f file-perms
Comments
