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

Author Message
Kelly121

Guest


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

Advertisements
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.
Kelly121

Guest


Any updates on this would be highly appreciated. Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26553
Location: Prague, Czechia
"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

Guest


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.
Kelly121

Guest


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

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

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26553
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?
Advertisements

You can post new topics in this forum






Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License