Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

damian

I tried with "> output.txt" but didn't have winscp.com file (not available in portable executable).

Now it works great. Thank you
martin

damian wrote:

@prikryl: I did. I run my program with the following parameters (using portable executable):
winscp417.exe /script=myscript.txt /log=my_log.log

I mean redirecting output on the program like:
winscp.com /script=myscript.txt /log=my_log.log > output
damian

@prikryl: I did. I run my program with the following parameters (using portable executable):
winscp417.exe /script=myscript.txt /log=my_log.log

myscript.txt looks like this:

option batch on
option confirm off
open ftp://user:password@ipaddress
option transfer binary
cd /some_folder/
put c:\test\*.txt
ls
close
exit

And part of my_log.txt file:
< 2008-10-28 15:40:57.375 200 PORT command successful.
> 2008-10-28 15:40:57.375 LIST -a
< 2008-10-28 15:40:57.406 150 Opening ASCII mode data connection for file list.
< 2008-10-28 15:40:57.406 226-Transfer complete.
< 2008-10-28 15:40:57.406 226 Quotas off
. 2008-10-28 15:40:57.406 Directory listing successful
. 2008-10-28 15:40:57.406 Disconnected from server
. 2008-10-28 15:44:43.422


As you can, the output is redirected to the file, but there's no way I can see listed files.
martin

Re: how to save ls output to log file

you can redirect output of the script to file and use ls command in the script.
damian

how to save ls output to log file

Hi,

I'm able to connect to my remote machine via ftp (using script file), upload some files and save this to log. However, when I try to list uploaded files using 'ls' command I only get:

> 2008-10-28 15:40:57.375 LIST -a
< 2008-10-28 15:40:57.406 150 Opening ASCII mode data connection for file list.
< 2008-10-28 15:40:57.406 226-Transfer complete.
< 2008-10-28 15:40:57.406 226 Quotas off
. 2008-10-28 15:40:57.406 Directory listing successful
. 2008-10-28 15:40:57.406 Disconnected from server

As you can see, ls does nothing at all. There is no output from this command in the log file.

I tried using call ls, but I got an error:
> 2008-10-28 15:44:43.547 ls
< 2008-10-28 15:44:43.547 500 LS not understood.
* 2008-10-28 15:44:43.547 (ExtException) LS not understood.
. 2008-10-28 15:44:43.547 Disconnected from server

Is there some other way to list uploaded files? I need this to check their sizes on the remote machine (and compare it to the ones I keep locally).

Thanks in advance