Rsync for Windows cannot run on Task Scheduler

2019-07-11 13:28发布

问题:

I have batch script stated below and I run it on Task scheduler (Windows 2008 R2). When it runs, the status of the task is still running and takes too long. I couldn't see any errors or even in history or any logs. I already set the correct owner and permission of the locations in windows. Any one can shed me some lights? Thanks!

SETLOCAL

SET CWRSYNCHOME=C:\scripts\CWRSYNC
SET CYGWIN=nontsec
SET HOME=%HOMEDRIVE%%HOMEPATH%
SET CWOLDPATH=%PATH%
SET PATH=%CWRSYNCHOME%\BIN;%PATH%

rsync -rltDuv --progress -e "ssh -i /cygdrive/c/scripts/id_rsa"  /cygdrive/c/backup/ root@123.123.123.123:/path/to/backup/ > c:/scripts/logs.txt 2>&1