I am running a script to transfer all files from a folder to a remote SFTP server but not all of the files transferred. There were 104 small files in the folder and only 42 of them transferred. Below is an excerpt from the log of the session:
. 2025-07-15 16:56:02.827 Using stored password.
< 2025-07-15 16:56:02.827 Script: Authenticating with pre-entered password.
. 2025-07-15 16:56:02.827 Sent password
. 2025-07-15 16:56:02.909 Access granted
. 2025-07-15 16:56:02.909 Opening main session channel
. 2025-07-15 16:56:02.972 Opened main channel
. 2025-07-15 16:56:03.035 Started a shell/command
< 2025-07-15 16:56:03.035 Script: Authenticated.
. 2025-07-15 16:56:03.035 --------------------------------------------------------------------------
. 2025-07-15 16:56:03.035 Using SFTP protocol.
. 2025-07-15 16:56:03.035 Doing startup conversation with host.
< 2025-07-15 16:56:03.035 Script: Starting the session...
. 2025-07-15 16:56:03.035 Not well known server, limiting to safe SFTP version 3.
. 2025-07-15 16:56:03.098 SFTP version 3 negotiated.
. 2025-07-15 16:56:03.098 We believe the server has signed timestamps bug
. 2025-07-15 16:56:03.098 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2025-07-15 16:56:03.098 Getting current directory name.
. 2025-07-15 16:56:03.163 Startup conversation with host finished.
< 2025-07-15 16:56:03.163 Script: Session started.
< 2025-07-15 16:56:03.164 Script: Active session: [1] 999_Winphrama_Interface@69.43.201.131
> 2025-07-15 16:56:03.165 Script: cd "/Winpharma_Inbound/Incoming RDE messages"
. 2025-07-15 16:56:03.165 Changing directory to "/Winpharma_Inbound/Incoming RDE messages".
. 2025-07-15 16:56:03.234 Trying to open directory "/Winpharma_Inbound/Incoming RDE messages".
. 2025-07-15 16:56:03.301 Getting current directory name.
< 2025-07-15 16:56:03.301 Script: /Winpharma_Inbound/Incoming RDE messages
> 2025-07-15 16:56:03.301 Script: lcd C:\EHRYW\RDE_Out
< 2025-07-15 16:56:03.301 Script: C:\EHRYW\RDE_Out
> 2025-07-15 16:56:03.302 Script: put *.txt
. 2025-07-15 16:56:03.307 Copying 42 files/directories to remote directory "/Winpharma_Inbound/Incoming RDE messages" - total size: 34,972
I was able to transfer the remaining files using the WinSCP app without any problem. Is there a limit on the number or total size of the file transfer?
Here is the script being run:
*****************************
# WinSCP script file for RDE upload to EHRYourWay
# change connection as needed and change the local directories for each site
open sftp://999_Winphrama_Interface:7502Z8vb@69.43.201.131/ -hostkey="ssh-rsa 1024 U7gTHqAEWWcc9s4RaafFus7Ijsdvqbd/3IS8Juih3ys"
# change remote directory
cd "/Winpharma_Inbound/Incoming RDE messages"
# change local directory
lcd C:\EHRYW\RDE_Out
# upload RDE files
put *.txt
exit
And this is the cmd file executing the script:
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /log="C:\EHRYW\Log\WinSCP.log" /ini=nul /script="C:\EHRYW\EHRYW_RDEOUT_TXF.txt" /loglevel=-1
if %ERRORLEVEL% neq 0 goto error
rem echo Upload succeeded, moving local files
move C:\EHRYW\RDE_OUT\*.* C:\EHRYW\Archive\
exit /b 0
:error
rem echo Upload failed, keeping local files
exit /b 1
:end
Any help appreciated.