Topic "Can't get log or output"

Author Message
lefevre.10
[View user's profile]

Joined: 2008-04-22
Posts: 3
Hey all -

I'm setting up WinSCP to download our webhost files to an office PC.

I'm writing a script to have an automated download every morning, but I'm having problems testing and troubleshooting it. The files aren't being downloaded, and I can't figure out why. Furthermore, I can't get logging to work, which is really the problem.

I'm using the /log switch, but I don't see any log file created. I did a windows search, but if it turned up, I didn't see it in all the results. I also tried outputing the results to a text file, as the documentation recommends, but the output file is empty.

C:\Program Files\WinSCP>winscp.exe /log /script=download_backups.txt > output.txt
C:\Program Files\WinSCP>dir output.txt
04/22/2008 09:49a 0 output.txt
1 File(s) 0 bytes

Where is the log file located?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
1) You have to specify filename after /log. E.g winscp /log=c:\winscp.log
2) Only output of winscp.com (not winscp.exe) can be redirected.
_________________
Martin Prikryl
lefevre.10
[View user's profile]

Joined: 2008-04-22
Posts: 3
Wonderful!

There is a place where the documentation should be updated. The Scripting FAQ says you should save a log to troubleshoot, by using /log .

https://winscp.net/eng/docs/guide_automation#results
"Checking script results

To check results of the script your can:

* Check exit code of WinSCP. See example below and another FAQ.
* Save and inspect log file. Use command-line parameter /log.
"

However, it doesn't indicate that you need to specify a log file.

I did overlook the part about output re-direction only being available in winscp.com Wink
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
lefevre.10 wrote:
However, it doesn't indicate that you need to specify a log file.

It is indicated in the linked page.
_________________
Martin Prikryl
lefevre.10
[View user's profile]

Joined: 2008-04-22
Posts: 3
Where is it located?

Using the search function in firefox, the only reference to the log switch I could find was this:

"Save and inspect log file. Use command-line parameter /log"
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
lefevre.10 wrote:
"Save and inspect log file. Use command-line parameter /log"

Sure. And there is a link leading to Command-line Options.
_________________
Martin Prikryl
chuck_ne

Guest


I seem to be having trouble getting the log file to be created if winscp3.com is invoked from a batch file. If I type this command at the CMD prompt, it works. ???

@echo off
WinSCP3.com /log=foo /script=XFER /ini=WinSCP3.ini
if errorlevel 1 goto myerror
goto continue
:myerror
Echo There was an error
goto end
:continue
cscript timeone.vbs
:end
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
chuck_ne wrote:
I seem to be having trouble getting the log file to be created if winscp3.com is invoked from a batch file. If I type this command at the CMD prompt, it works. ???

I'm not able to reproduce that. What version of WinSCP are you using? Can you try the latest one?
_________________
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