cwrsync in windows not being recognised

我们两清 提交于 2019-12-08 03:08:15

问题


I am trying to move from a mac environment to a windows one and require rsync.

Found cwrsync @ http://www.rsync.net/resources/howto/windows_rsync.html

I have installed the cwrsync program fine, I can call the rsync at cmd but on when in the directory which contains the sync.exe

When in command prompt, if i call rsync when not in the relavent directory it moans and sayS:

"rsync" is not recognised as an internal or external command, operable program or batch file.

Is there a way to add the rsync.exe to a global list so as rsync is recognised outside of its immediate parent directory?

Thanks, John


回答1:


Add the path in the Windows system variables:

- Control Panel -> System -> tab Advanced, button Environment Variables.
- Edit the "Path" system variable and add the full path to the installed rsync:
     C:\Program Files\cwRsync\bin or C:\cygwin\bin. or
     C:\Program Files (x86)\cwRsync\bin or C:\cygwin\bin.

This way the commands rsync and ssh should run from any directory. Make sure you put in the correct install path to the application else it won't work. See screenshot below:

Environment Variable Setup: Make sure the path you added is under System Variables:

Command: As seen, I am running this directly from root of C: drive




回答2:


cwRsync distribution contains a batch file example called cwrsync.cmd with correct path settings. You can simply add your rsync command into that file.



来源:https://stackoverflow.com/questions/20493309/cwrsync-in-windows-not-being-recognised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!