Scripting a 100+ GB upload and keep getting
Network error: Software caused connection abort, timeouts, and taking a very long time.
It either retries or sometimes freezes and I have to break out and try again. It does resume where it left off, but can't seem to get it to complete. Any help would be appreciated.
.bat file
rem "C:\Program Files\7-Zip\7z.exe" a "D:\ONEDRIVE\PRM_BACKUP\%DATE:~7,2%.%DATE:~4,2%.%DATE:~-4% Backup".zip D:\ONEDRIVE\PRM_Backup\*.bak
move "D:\OneDrive\PRM_Backup\*.zip" "D:\OneDrive\PRM_Backup\temp\"
"C:\Program Files (x86)\WinSCP\winscp.com" /script="C:\Program Files (x86)\WinSCP\Upload.txt" /log="C:\temp\UploadPRM.log"
if %ERRORLEVEL% neq 0 goto error
echo Upload succeeded, moving local files
move "D:\OneDrive\PRM_Backup\Temp\*.zip" "D:\OneDrive\PRM_Backup\Archive"
move "D:\OneDrive\PRM_Backup\Temp\*.bak" "D:\OneDrive\PRM_Backup\Archive"
forfiles /p "D:\OneDrive\PRM_Backup\Temp" /s /m *.zip /D -2 /C "cmd /c del @path"
exit /b 0
:error
echo Upload failed, keeping local files
exit /b 1
.txt file
;WinSCP script to zip files and upload to SFTP server
; Save this with .txt extension and run with WinSCP.com
option batch abort
option confirm off
; Connect to SFTP server
open sftp://username:password@sftp.domain.com -rawsettings SendBuf=0
bin
; Upload zip file
put "D:\ONEDRIVE\PRM_BACKUP\temp\*.zip"
; Close connection
close
exit
uploadPRM.log is full of these messages
. 2025-04-04 12:20:42.526 There are 56672 bytes remaining in the send buffer
. 2025-04-04 12:20:42.526 There are 56672 bytes remaining in the send buffer, need to send at least another 23904 bytes
. 2025-04-04 12:20:42.526 Detected network event
. 2025-04-04 12:20:42.526 There are 56672 bytes remaining in the send buffer
. 2025-04-04 12:20:42.526 There are 56672 bytes remaining in the send buffer, need to send at least another 23904 bytes
. 2025-04-04 12:20:42.526 Received 26 bytes
. 2025-04-04 12:20:42.526 Read 4 bytes (22 pending)
. 2025-04-04 12:20:42.526 Read 22 bytes (0 pending)
< 2025-04-04 12:20:42.526 Type: SSH_FXP_STATUS, Size: 22, Number: 7182854
< 2025-04-04 12:20:42.526 Status code: 0
. 2025-04-04 12:20:42.542 Detected network event
. 2025-04-04 12:20:42.542 There are 56672 bytes remaining in the send buffer
. 2025-04-04 12:20:42.542 There are 56672 bytes remaining in the send buffer, need to send at least another 23904 bytes
. 2025-04-04 12:20:42.542 Received 26 bytes
. 2025-04-04 12:20:42.542 Read 4 bytes (22 pending)
. 2025-04-04 12:20:42.543 Read 22 bytes (0 pending)