Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: ("Copying files from remote side failed.","Could not open file for reading.")

The error comes from the server. Is it always a .tmp file you have a problem with? Maybe you should exclude those files from the synchronization.
hilal

("Copying files from remote side failed.","Could not open file for reading.")

Hello! I'm trying to automate downloading backups from my server.
I use Task Scheduler in Windows 10.

Code of script
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="D:\..\..\n.log" /ini=nul ^
  /command ^
      "open ftp://..................." ^
   "synchronize local D:\BACKUP /./.. " ^
       "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

and an error occurs because there are several files that are being used, with an error message
. 2021-11-24 13:36:45.412 Connecting to 10.00.00.00:6281 ...
< 2021-11-24 13:36:45.413 150 Opening data channel for file download from server of "/EMAIL/~y...._..@i........co.id.pst.pst.tmp"
< 2021-11-24 13:36:45.414 550 Could not open file for reading.
. 2021-11-24 13:36:45.414 Copying files from remote side failed.
* 2021-11-24 13:36:45.414 (ExtException) **Copying files from remote side failed.**
* 2021-11-24 13:36:45.414 Could not open file for reading.
. 2021-11-24 13:36:45.414 Asking user:
. 2021-11-24 13:36:45.414 Error transferring file '/EMAIL/~y...._..@i........co.id.pst.tmp'. ("Copying files from remote side failed.","Could not open file for reading.")
< 2021-11-24 13:36:45.414 Script: Error transferring file '/EMAIL/~y...._..@i.......co.id.pst.tmp'.
< 2021-11-24 13:36:45.414 Script: Copying files from remote side failed.
 
< 2021-11-24 13:36:45.414 Could not open file for reading.
. 2021-11-24 13:36:45.416 Answer: Abort
* 2021-11-24 13:36:45.416 (ESkipFile) Error transferring file '/EMAIL/~y...._..@i........co.id.pst.tmp'.
* 2021-11-24 13:36:45.416 Copying files from remote side failed.
* 2021-11-24 13:36:45.416 Could not open file for reading.
. 2021-11-24 13:36:45.416 Copying finished: Transferred: 0, Elapsed: 0:00:00, CPS: 0/s
. 2021-11-24 13:36:45.416 Script: Failed
. 2021-11-24 13:36:45.416 Script: Exit code: 1
. 2021-11-24 13:36:45.417 Disconnected from server