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

Mangala

The issue is fixed!! Thank you so much. Using ls command, I was able to see that the file was not posed on a timely manner on the SFTP. We adjusted the code to get the file on its available time. Thanks again.
martin

Re: File Copy using WinSCp fails using Task Manager

Put ls command before the get and post full session log files both to the failing scheduled execution and working manual execution.
Mangala

File Copy using WinSCp fails using Task Manager

I have created a batch script that calls a SSIS Package. I have defined a Execute Process Task that calls WinSCP.exe(5.17.7) to copy a file from SFTP location to my local machine.
Manual execution of batch script works without issues. I have a scheduled job in Task Manager and when I manually run the job in Task Manager, the script works fine and the files get copied to my local system.
But when I schedule the job in Task Manager for execution at 12.15 AM everyday, it fails with Error Code 2:
> 2020-10-08 00:15:15.067 Script: get "ucid.log.2020-10-07" E:\SSIS_ROOT\OCCAS_to_DB\OCCAS_Logs\APSRP8962\

. 2020-10-08 00:15:15.067 Listing file "ucid.log.2020-10-07".
> 2020-10-08 00:15:15.067 Type: SSH_FXP_LSTAT, Size: 109, Number: 43527
< 2020-10-08 00:15:15.069 Type: SSH_FXP_STATUS, Size: 29, Number: 43527
< 2020-10-08 00:15:15.069 Status code: 2, Message: 43527, Server: No such file, Language: 
< 2020-10-08 00:15:15.069 Script: Can't get attributes of file 'ucid.log.2020-10-07'.
< 2020-10-08 00:15:15.069 No such file or directory.
< 2020-10-08 00:15:15.069 Error code: 2
< 2020-10-08 00:15:15.069 Error message from server: No such file
. 2020-10-08 00:15:15.069 Script: Failed
. 2020-10-08 00:15:15.069 Script: Exit code: 1

What could be the reason?The file definitely exists in the SFTP location.