GUI works/batch mode fails

Advertisement

GreenRT
Joined:
Posts:
3
Location:
Guadalajara, Mexico

GUI works/batch mode fails

I am using WinSCP 4.0.7 (Build 370) to transfer files via FTP in batch mode. If I connect to the server with the GUI it works fine but the batch script fails. It worked fine until about a week ago, then it stopped working. I cannot figure out what changed.

A typical batch script is:
# 20080302-2024-a1-ftp.tmp
option batch on
confirm off
open ftp://xxx:yyy@200.12.166.180
option transfer binary
cd BIN_level1b/2008/0803
lcd X:\modis\20080302-2024-a1
get 20080302.2024.a1.modis_cal.png
get 20080302.2024.a1.modis_cal_250_b1.tar.bz2
get 20080302.2024.a1.modis_cal_250_b2.tar.bz2
get 20080302.2024.a1.modis_cal_500_b7.tar.bz2
close


It is called with
WinSCP.exe /script=%ftpTempName% /log=%fecha%-%hhmm%-%sat%-winscp.log

The log file contains:
. 2008-03-16 11:28:46.216 Using FTP protocol.
. 2008-03-16 11:28:46.231 Doing startup conversation with host.
> 2008-03-16 11:28:46.231 PWD
< 2008-03-16 11:28:46.247 257 "/" is current directory.
. 2008-03-16 11:28:46.247 Getting current directory name.
. 2008-03-16 11:28:46.247 Startup conversation with host finished.
. 2008-03-16 11:28:46.263 Cached directory change via "BIN_level1b/2008/0803" to "/BIN_level1b/2008/0803".
. 2008-03-16 11:28:46.263 Getting current directory name.
. 2008-03-16 11:28:46.263 Listing file "20080302.2024.a1.modis_cal.png".
. 2008-03-16 11:28:46.278 Retrieving directory listing...
> 2008-03-16 11:28:46.278 CWD /BIN_level1b/2008/0803/
< 2008-03-16 11:28:46.310 250 CWD command successful.
> 2008-03-16 11:28:46.310 PWD
< 2008-03-16 11:28:46.325 257 "/BIN_level1b/2008/0803" is current directory.
> 2008-03-16 11:28:46.325 TYPE A
< 2008-03-16 11:28:46.356 200 Type set to A.
> 2008-03-16 11:28:46.403 PORT 10,0,2,210,9,19
< 2008-03-16 11:28:46.419 200 PORT command successful.
> 2008-03-16 11:28:46.419 LIST -a
< 2008-03-16 11:28:46.435 150 Opening ASCII mode data connection for /bin/ls.
. 2008-03-16 11:29:01.778 Timeout detected.
. 2008-03-16 11:29:01.778 Could not retrieve directory listing

Any ideas on where to look for the problem?

Thanks,
Will

Reply with quote

Advertisement

GreenRT
Joined:
Posts:
3
Location:
Guadalajara, Mexico

I thought about that and even tried it, but I am not sure I know how to change to passive mode in a script.

Is the command?
option passive on

There is also a command line flag, but I could not find how to use it. Should I use:

winscp.exe /script=xxx /passive=on

or should it be
option passive yes
/passive=yes

Also, in looking at my own post I notice I have
confirm off
in the script instead of
option confirm off

I will check to see if that is the problem.

Will

Reply with quote

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

GreenRT wrote:

I thought about that and even tried it, but I am not sure I know how to change to passive mode in a script.
You cannot yet. It will be possible in the next release (see tracker). However you can save stored session with passive mode enabled in GUI and use that session from script.

Reply with quote

Advertisement

You can post new topics in this forum