Logfile error

Advertisement

Guest
Guest

Logfile error

Hi there,
i have a extern winscp-script, opened via a batch file.
i'm opening with the following parameters:

WinSCP.com /script=scpscript.txt /log=log.txt

in my logfile, the first lines are:

batch on
confirm off
Error occured during logging. It's been turned off.
Can't open log file 'log.txt'.
Searching for host...
Connecting to host...
Authenticating...


there is an existing file called log.txt in the same folder as the batch and the winscp script. forgot anything?
ps: read doc and faq a few times before but still without an idea.

thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Logfile error

The above is not what log file should look like. It is regular output of the script. It looks like you are actually doing:
WinSCP.com /script=scpscript.txt /log=log.txt > log.txt

Reply with quote

Advertisement

martin
Site Admin
martin avatar

I've been asking what does happen if you execute the command below in the same directory where you are executing WinSCP.

echo blah > log.txt

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Anonymous wrote:

thats the reason why i use >> instead of >
logs of more passes in 1 logfile
Where do you use >>? You have never mentioned that.

Reply with quote

Guest

1. batch opens another and writes 1&2 logs to log.txt
bat1.bat>>log.txt 2>&1
2. second bat opens the script with
WinSCP.com /script=scpscript.txt /log=log.txt
second bat does other commands too after exiting the script.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Anonymous wrote:

1. batch opens another and writes 1&2 logs to log.txt
bat1.bat>>log.txt 2>&1
2. second bat opens the script with
WinSCP.com /script=scpscript.txt /log=log.txt
second bat does other commands too after exiting the script.
And that's exactly the problem I've pointed you to in my first reply. You cannot write to a single file from two processes.

Reply with quote

Guest2
Guest

Can't create logfile

I have a similar, but not the same, problem...
I have only a single batch file that issues the command
call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"

The script runs, transfers the files, everything is fine but there is no log file created.
When running it, I see the following in the command window:

call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"
batch on
confirm off
141
Can't open log file '\\server\folder\log.txt
... and then on to transferring the files as normal.

ideas? Is there a way to specify the logfile in the script instead?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Can't create logfile

Guest2 wrote:

call c:\winscp\winscp.com /console /script="\\server\folder\script.txt /log="\\server\folder\log.txt"
You are missing quote after script.txt.
Let us know if it helps.

Reply with quote

Advertisement

You can post new topics in this forum