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.