Post a reply

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

The file is indeed not in the target directory, even though the upload succeeded.

On *nix server, the permissions "r-xr-xr-x" would indeed indicate, that you cannot write to the directory.

But it's some custom SFTP server, it may not be based on *nix, and the permissions it reports can easily be fake.

There's hardly anything more I can debug remotely. WinSCP uploaded the file, the server acknowledged the upload. The file is not there yet. It looks like a bug in the server to me (either it discarded the file for some reason; or it failed to report some error, that prevented the upload). I do not see anything wrong on WinSCP side.

Are you able to upload the file to their server anyhow? Using WinSCP GUI? Using any other SFTP client?
Kelly121

Our client notified that the transmission is based on password based authentication only, no public key required. I used ls in the script. Log file was attached. Client did not receive the file but log shows Transfer done.
Kelly121

Re: Could not deliver the file to SFTP in windows automation but log is showing success

Kelly121 wrote:

martin wrote:

"The file could not deliver to SFTP location" - How do you check that?

Add ls /inbound/bsy before exit and post a new log file.


Client notified us that the file was not delivered. But the log was showing something different.


Hello Martin,

When I logged into the environment with provided password I found folder level permission was set in 555 i.e. r-xr-xr-x. Is it stopping the file to be delivered? If so then I wonder when we execute script manually then how the file gets delivered. Please advise,
Kelly121

Re: Could not deliver the file to SFTP in windows automation but log is showing success

martin wrote:

"The file could not deliver to SFTP location" - How do you check that?

Add ls /inbound/bsy before exit and post a new log file.


Client notified us that the file was not delivered. But the log was showing something different.
martin

Re: Could not deliver the file to SFTP in windows automation but log is showing success

"The file could not deliver to SFTP location" - How do you check that?

Add ls /inbound/bsy before exit and post a new log file.
Kelly121

Any updates on this would be highly appreciated. Thank you.
Kelly121

Here i can think two options.
1. There are nothing specified in argument field.
2.There are some extra commands in my batch file like before running winscp command it will check holiday.txt file.

Please advise.

Thanks.
Kelly121

Could not deliver the file to SFTP in windows automation but log is showing success

Hello,

The file could not deliver to SFTP location but in Log file it is showing as success. I created a job through windows automation using below script.

cd %Root%

for /f %%a in (.\Jobs\Holidays.txt) do (
if %%a == %date:~-10,2%/%date:~-7,2%/%date:~-4% (
exit
)
)

@echo off
cd "C:\Program Files (x86)\WinSCP"
winscp.com /log=C:\pa\Jobs\BlS\Log\winscp.log /script=Prod.txt
exit


In Prod.txt I have used below.

option batch abort
option confirm off
open sftp://user:password@sername/ -privatekey="PuTTYPrivateKey.ppk"
put C:\TA\blS\BSN.txt /inbound/bsy/
EXIT

I have attached the log file. Could you please let me know what I am missing.