Can't get log or output

Advertisement

lefevre.10
Joined:
Posts:
3

Can't get log or output

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,209
Location:
Prague, Czechia

Re: Can't get log or output

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

Reply with quote

lefevre.10
Joined:
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 ;)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,209
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

Reply with quote

lefevre.10
Joined:
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"

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,209
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

Reply with quote

chuck_ne
Guest

Log file

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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,209
Location:
Prague, Czechia

Re: Log file

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

Reply with quote

Advertisement

You can post new topics in this forum