Since my upgrade to the latest version(5.5.0 Free) of cwrsync, the keys aren't found any more.
Here is my batch that worked.
What I'm doing wrong.
@ECHO OFF
REM Make environment variable changes local to this batch file
SETLOCAL
REM ** Specify where to find rsync and related files
SET CWRSYNCHOME=D:\Tools\cwRsync
REM Set HOME variable to your windows home directory. That makes sure
REM that ssh command creates known_hosts in a directory you have access.
SET HOME==C:\Users\Administrator\
REM %USERPROFILE%
REM Make cwRsync home as a part of system PATH to find required DLLs
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%;%CWRSYNCHOME%\bin;%PATH%
ECHO "START RSYNC"
rsync -avzr --progress --remove-source-files '/cygdrive/e/backup/' 'backupuser@1.1.1.1:/volume1/BACKUP/'
Latest versions of Cygwin DLL don't recognize HOME variable from a DOS environment. We have updated cwrsync.cmd file to cope with the problem:
Hello,
thanks for your answer. But this change is very annoying.
If I use multiple ssh based applications I 've to store the keys in different locations. Not very usefull I think.
For example cwRsync is using /home/%User%/.ssh and OpenSSH is using C:/Users/%User%/.ssh
Do you know the reason of this change?
If %HOME% is in the install path, by default C:\Program Files\cwRsync, then with this change only users with write access to the install path, usually administrators, can add the ssh keys. Please reenable settting a user defined %HOME%.
As described above, that change appeared in the recent versions of Cygwin DLL - we can't do anything about it. The solution above is just to overcome that problem. It may have some side effects as you describe. You can always make symbolic links from /home directory to user's real home directory.
Ok, granted that it is cygwin's fault. Regarding the workaround, that still demands superuser rights to create a symlink to %USERPROFILE% in C:\Program Files\cwRsync.
One possible solution can be to create etc/fstab to redirect /home directory to somewhere else (C:\users in the example below):
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
c:/users /home ntfs override,binary,noacl 0 0
See our FAQ for more detailed information and links
This one solved the issue for me. Thanks:
------------------------
One possible solution can be to create etc/fstab to redirect /home directory to somewhere else (C:\users in the example below):
none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
c:/users /home ntfs override,binary,noacl 0 0
------------------------------------------------
Just wondering is it possible to set "HOME" variable for Cygwin.dll via a file in "/etc" like "/etc/profile"?
You can do that if you run rsync via a Cygwin-compatible shell like bash. We will consider to extend the free edition by a bash shell to overcome that issue.