Can cwRsync co-exist if cygwin is already installed?

YES: Cygwin 1.7 binaries used by cwRsync allow co-existence of multiple Cygwin implementations.

⌂

Can rsync transfer security/ownership information between two windows machines?

cwRsync itself has no support for it. However, after an rsync operation, you can use Robocopy (standard in more recent Windows versions), to transfer all windows specific file information (NTFS security, timestamps, attributes, ownership, auditing info):

ROBOCOPY source destination /XO /XN /XC /E /COPY:ATSOU

The options /XO (exclude older), /XN (exclude newer) and /XC (exclude changed) assure that only existing files are targeted. Option /E is for recursive directory operation including empty ones. Option /COPY:ATSOU instructs Robocopy to copy only attributes (A), timestamps (T), NTFS security information (S), Ownership (O) and auditing (U).

⌂

cwRsync client is too slow!

Try to remove /etc/fstab and use the option --no-perms instead. The problem can also be related to real-time anti-virus scanning. Consider file/folder exclusion if possible.

⌂

How can I secure connections between cwRsync clients and unix/linux servers?

cwRsync has all ssh binaries you need to establish ssh communication.

Use batch file example in the cwRsync client package to set up communication correctly.

⌂

I can’t use long path names

From Windows Developer network:

“In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is “D:\some 256-character path string<NUL>” where “<NUL>” represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function (this value is commonly 255 characters). To specify an extended-length path, use the “\?\ prefix. For example, “\?\D:\very long path”.”

Even if the underlying APIs may have support for really long paths, the problem occurs due to user interface tools like Windows Explorer, Cmd prompt and PowerShell which don’t support Unicode variants of the Windows APIs. The result is then path names up to 256 chars. As of version 1.7, Cygwin uses unicode Windows APIs, you can use tools like bash shell or nano editor for management of files/paths with long names.

Log example for cwRsync transfer with long path names:

...
2014/03/25 22:08:42 >f+++++++++
backup/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/testfile
...

⌂

I want to set up ssh communication without passwords!!

Here is a simple recipe (NB! This is not a very secure solution, since we use null passphrase during generation of public key pairs, use it at your own risk):

  • cwRsync client. Generate key pairs:

    ssh-keygen -q -t rsa -f cwrsync -N ""
    

    Files cwrsync and cwrsync.pub will be generated.

  • Transfer cwrsync.pub to your *nix machine.

  • *nix machine. Run following commands:

    mkdir -p ~$user/.ssh
    cat cwrsync.pub > ~$user/.ssh/authorized_keys
    chmod 755 ~$user ~$user/.ssh
    chmod 644 ~$user/.ssh/authorized_keys
    chown $user ~$user ~$user/.ssh ~$user/.ssh/authorized_keys
    
  • cwRsync client. Update your rsync commands in your batch file by specifying option -e "ssh -i cwrsync".

⌂

Permissions on files/directories are cluttered/mixed up!

If you run into permissions problems or your directories’ security ACLs are populated by some unwanted groups/users, you need to make sure that:

  • File ../etc/fstab exists with at least the content below (with Unix line endings even if the file has only one line!):

    none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
    

    That will instruct Cygwin not to touch permissions.

NB! You may experience very slow transfer rates and/or building the file list may take long time. You can remove /etc/fstab and use the option --no-perms instead. The problem can also be related to real-time anti-virus scanning. Consider file/folder exclusion if possible.

More information:

⌂

Rsync does not recognize windows paths in a correct manner!

Windows paths may contain a colon (:) as a part of drive designation and backslashes (example c:\ g:\. However, in rsync syntax, a colon in a path means searching for a remote host.

Solution: use absolute path ‘a la unix’, replace backslashes (\ with slashes (/) and put /cygdrive/ in front of the drive letter.

Example:

C:\WORK\* --> /cygdrive/c/work/*

⌂

Why does my cwRsync try to load ssh?

It’s trying to fire up ssh because your target has a single colon in it.

  • server:/path/to/stuff means “fire up ssh or rsh and make me a tunnel to server”
  • server::module/path/to/stuff means “try to access an rsync daemon on server and access path/to/stuff on module”
  • /path/to/stuff means “access /path/to/stuff on the local machine”

Hope that helps.

by Jim Salter

⌂

Why is it called cwRsync?

Use of vocals would be inappropriate (!) as the word rsync has no vocals in it, and this package is also dependent on Cygwin:

CYGWIN + RSYNC

⌂