Zend certified PHP/Magento developer

Cygwin weird behavior on security permissions

I’m using Cygwin to run periodic backups, for example I do:

cp -a "$(cygpath C:UsersSDocuments)" "$BU_FOLDER"

But I’ve noticed the commands that create folders or files such as cp or mkdir, create special permissions on the Properties -> Security tab (on Windows explorer) as to create a POSIX-compatible environment on Windows I believe.

And this causes issues. If you follow these steps, you will get locked out from accessing your files in the copied destination.

  • If I run the command above to copy the Documents folder
  • And then decide to delete a folder in the destination ($BU_FOLDER/Documents/myfolder)

Then Windows hangs for a little bit, deletes the folder but locks me out from viewing the folder:

enter image description here

These permissions are added in the security tab when you use cp or mkdir:

enter image description here

I can’t find a way to remove these permissions from all folders recursively.

Should I stop using Cygwin? These permissions work fine inside Cygwin, I can modify folders and files in the destination but when I do on Windows explorer, these weird unexpected behaviors happen which confuses me as an end user.