I created a bat file like this:
@echo off :loop "C:\Program Files\WinSCP\WinSCP.com" ^ /command ^ "open sftp://email@example.com/ -hostkey="xxxxxxxxxx" -privatekey="xxxxxxx" -timeout=180 -rawsettings PingType=1" ^ "synchronize local c:/shares /var/www/shares" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) timeout /t 120 goto loop
Then, I run this bat once and it works indefinitely. Is this the correct way to do this?
Also, if a file is too large and doesn't finish in 120 seconds, will it be a problem in the next run?