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

Advertisement

Kelly121
Guest

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.
  • log.txt (8.9 KB, Private file)
Description: Log file for SFTP

Reply with quote

Advertisement

Kelly121
Guest

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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.

Reply with quote

Kelly121
Guest

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.

Reply with quote

Advertisement

Kelly121
Guest

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,

Reply with quote

Kelly121
Guest

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.
  • winscplog2.txt (10.11 KB, Private file)
Description: log file

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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?

Reply with quote

Advertisement

You can post new topics in this forum