Topic "error 141 can't open log file"

Author Message
mreinsmith
[View user's profile]

Joined: 2014-07-29
Posts: 3
I run a batch file with the following command

C:\Progra~2\WinSCP\winscp.exe /console /script=transfer.txt /xmllog=transfer.log /nointeractiveinput

it runs the script 'transfer.txt' as shown here

option batch on
option confirm off
option transfer ascii
open sftp://root:password1@server1 -hostkey=*
lcd V:\test
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password2@server2 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password3@server3 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

open sftp://root:password4@server4 -hostkey=*
cd /remote1
mput *.xml
cd /remote2
mput *.xml

it correctly logs the result for "server1" but after it connects to server2 i get the error "141 can't open log file 'transfer.log'

the log then is written to V:\test (the local directory shown above) and server2 logs correctly to that copy.

from there, SERVER3 and SERVER4 don't get logged anywhere

any ideas how to correct this behaivor?

Thank You

M
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
I cannot reproduce your problem with any version of WinSCP. What version are you using?

Anyway, it's not a good idea to log all sessions into one file (one would overwrite the other). Consider using some session-specific pattern in the log path. E.g. !S:
C:\Progra~2\WinSCP\winscp.exe /console /script=transfer_!S.txt /xmllog=transfer.log /nointeractiveinput

See https://winscp.net/eng/docs/ui_pref_logging#session_log
_________________
Martin Prikryl
mreinsmith
[View user's profile]

Joined: 2014-07-29
Posts: 3
I used the following to activate the script

C:\Progra~2\WinSCP\winscp.exe /console /script=transfer.txt /xmllog=%USERPROFILE%\Desktop\transfer_!S.log /nointeractiveinput

it creates 4 separate logs, but at least I can easily verify the results

Thanks for your help

M
Advertisements

You can post new topics in this forum






Search Site

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