Topic "Logfile error"

Author Message
Guest

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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
_________________
Martin Prikryl
Guest




i am putting the winscp log in the same logfile like my winscp-starting batch-file.
doesn't work in that way?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
So what does happen if you do e.g.
echo blah > log.txt

in the same directory?
_________________
Martin Prikryl
Guest




yes batch, winscpscript and logfile in the same folder
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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
_________________
Martin Prikryl
Guest




logfile is overwritten with "blah".

thats the reason why i use >> instead of >
logs of more passes in 1 logfile
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
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.
_________________
Martin Prikryl
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
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.
_________________
Martin Prikryl
Guest2

Guest


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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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.
_________________
Martin Prikryl
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