cwrsync.cmd 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. @ECHO OFF
  2. REM *****************************************************************
  3. REM
  4. REM CWRSYNC.CMD - Batch file template to start your rsync command (s).
  5. REM
  6. REM By Tevfik K. (http://itefix.no)
  7. REM *****************************************************************
  8. REM Make environment variable changes local to this batch file
  9. SETLOCAL
  10. REM ** CUSTOMIZE ** Specify where to find rsync and related files (C:\CWRSYNC)
  11. SET CWRSYNCHOME=%PROGRAMFILES%\CWRSYNC
  12. REM Set HOME variable to your windows home directory. That makes sure
  13. REM that ssh command creates known_hosts in a directory you have access.
  14. SET HOME=%HOMEDRIVE%%HOMEPATH%
  15. REM Make cwRsync home as a part of system PATH to find required DLLs
  16. SET CWOLDPATH=%PATH%
  17. SET PATH=%CWRSYNCHOME%\BIN;%PATH%
  18. REM Windows paths may contain a colon (:) as a part of drive designation and
  19. REM backslashes (example c:\, g:\). However, in rsync syntax, a colon in a
  20. REM path means searching for a remote host. Solution: use absolute path 'a la unix',
  21. REM replace backslashes (\) with slashes (/) and put -/cygdrive/- in front of the
  22. REM drive letter:
  23. REM
  24. REM Example : C:\WORK\* --> /cygdrive/c/work/*
  25. REM
  26. REM Example 1 - rsync recursively to a unix server with an openssh server :
  27. REM
  28. REM rsync -r /cygdrive/c/work/ remotehost:/home/user/work/
  29. REM
  30. REM Example 2 - Local rsync recursively
  31. REM
  32. REM rsync -r /cygdrive/c/work/ /cygdrive/d/work/doc/
  33. REM
  34. REM Example 3 - rsync to an rsync server recursively :
  35. REM (Double colons?? YES!!)
  36. REM
  37. REM rsync -r /cygdrive/c/doc/ remotehost::module/doc
  38. REM
  39. REM Rsync is a very powerful tool. Please look at documentation for other options.
  40. REM
  41. REM ** CUSTOMIZE ** Enter your rsync command(s) here