Re: Incomplete file transfer
That's not easy to do.
See How to detect that a file is being uploaded over FTP
See How to detect that a file is being uploaded over FTP
My script seems to start moving files to new destination before its completed at source location.
-delete
switch? What do you mean by "completed at source location"?
Im sure WinSCP wait for a file to completly download and after that it start moving file to new destination.
get -delete
, there's no "moving" really. It's download and delete.
@echo off
FOR /f "tokens=2-4 skip=1 delims=(-)" %%G IN ('echo.^|date') DO (
FOR /f "tokens=2 delims= " %%A IN ('date /t') DO (
SET v_first=%%G
SET v_second=%%H
SET v_third=%%I
SET v_all=%%A
)
)
SET %v_first%=%v_all:~0,2%
SET %v_second%=%v_all:~3,2%
SET %v_third%=%v_all:~6,4%
REM =====================================================
:loop
"C:\Program Files\WinSCP\WinSCP.com" ^
/log="d:\WinSCP-Log_%dd%_%mm%_%yy%.LOG" /ini=nul ^
/command ^
"open ftp://user:password@my-ip:221/ -timeout=300 " ^
"OPTION BATCH CONTINUE" ^
"GET /* c:\folder1\* -delete -resume -neweronly" ^
"exit"
timeout /t 60
goto loop