script file works for one job but not a new job

Advertisement

dms
Joined:
Posts:
3
Location:
North Carolina

script file works for one job but not a new job

I have two different jobs running using the same setup script. The older one is working just fine but the new one is not. I setup the WinScp sessions just alike, only difference of course is login information. I setup to run log and the log is posted below. I also have pasted the script running below. Thanks for any insight. Tad at DMS.

Session name: MOTFTP (Site)
. 2018-06-22 12:41:10.585 Host name: ftp1.gcommerceinc.com (Port: 21)
. 2018-06-22 12:41:10.586 User name: motownauto.com (Password: Yes, Key file: No, Passphrase: No)
. 2018-06-22 12:41:10.586 Transfer Protocol: FTP
. 2018-06-22 12:41:10.586 Ping type: Dummy, Ping interval: 30 sec; Timeout: 420 sec
. 2018-06-22 12:41:10.586 Disable Nagle: No
. 2018-06-22 12:41:10.586 Proxy: None
. 2018-06-22 12:41:10.586 Send buffer: 262144
. 2018-06-22 12:41:10.586 UTF: Auto
. 2018-06-22 12:41:10.586 FTPS: None [Client certificate: No]
. 2018-06-22 12:41:10.586 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2018-06-22 12:41:10.586 Local directory: C:\Altova\Customer\MOT\Working\Outbound, Remote directory: /motownauto.com/Outbound, Update: Yes, Cache: Yes
. 2018-06-22 12:41:10.586 Cache directory changes: Yes, Permanent: Yes
. 2018-06-22 12:41:10.586 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2018-06-22 12:41:10.586 Timezone offset: 0h 0m
Connecting to ftp1.gcommerceinc.com ...
. 2018-06-22 12:41:10.684 Connected with ftp1.gcommerceinc.com. Waiting for welcome message...
< 2018-06-22 12:41:11.159 220 ftp1.gcommerceinc.com X2 WS_FTP Server 7.6.3(16270138)
> 2018-06-22 12:41:11.160 USER motownauto.com
< 2018-06-22 12:41:34.601 331 Enter password
> 2018-06-22 12:41:34.601 PASS *******
< 2018-06-22 12:41:40.488 230 User logged in
> 2018-06-22 12:41:40.488 SYST
< 2018-06-22 12:41:40.553 215 UNIX
> 2018-06-22 12:41:40.554 FEAT
< 2018-06-22 12:41:40.618 211-Extensions supported
< 2018-06-22 12:41:40.618 SIZE
< 2018-06-22 12:41:40.618 XMD5
< 2018-06-22 12:41:40.618 XSHA1
< 2018-06-22 12:41:40.618 XSHA256
< 2018-06-22 12:41:40.618 XSHA512
< 2018-06-22 12:41:40.618 XQUOTA
< 2018-06-22 12:41:40.618 LANG EN, ES, FR, GE
< 2018-06-22 12:41:40.618 MDTM
< 2018-06-22 12:41:40.618 MLST size*;type*;perm*;create*;modify*;
< 2018-06-22 12:41:40.618 REST STREAM
< 2018-06-22 12:41:40.618 TVFS
< 2018-06-22 12:41:40.618 UTF8
< 2018-06-22 12:41:40.618 AUTH SSL;TLS-P;
< 2018-06-22 12:41:40.618 PBSZ
< 2018-06-22 12:41:40.618 PROT C;P;
< 2018-06-22 12:41:40.619 211 end
> 2018-06-22 12:41:40.619 OPTS UTF8 ON
< 2018-06-22 12:41:40.684 200 Command OPTS succeed
. 2018-06-22 12:41:40.685 Connected

Session name: TCPFTPT (Ad-Hoc site)
. 2018-06-22 11:02:44.567 Host name: TCPFTPT (Port: 22)
. 2018-06-22 11:02:44.567 User name: (Password: No, Key file: No, Passphrase: No)
. 2018-06-22 11:02:44.567 Tunnel: No
. 2018-06-22 11:02:44.567 Transfer Protocol: SFTP (SCP)
. 2018-06-22 11:02:44.567 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2018-06-22 11:02:44.567 Disable Nagle: No
. 2018-06-22 11:02:44.568 Proxy: None
. 2018-06-22 11:02:44.568 Send buffer: 262144
. 2018-06-22 11:02:44.568 SSH protocol version: 2; Compression: No
. 2018-06-22 11:02:44.568 Bypass authentication: No

WINSCP /script=C:\\Altova\\Customer\\TCP\\SCRIPT.txt /log=\"C:\\winscp.log\" /loglevel=0
The script is below

OPEN TCPFTPT
LCD C:\Altova\Customer\TCP\Working\Outbound
cd /tricountypande.com/Outbound
Put PO_850_0000002.XML -filemask=PO_850_0000002.XML
Exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,658
Location:
Prague, Czechia

Re: script file works for one job but not a new job

Please attach a full session log file showing the problem (using the latest version of WinSCP).

Reply with quote

dms
Joined:
Posts:
3
Location:
North Carolina

Session is setup for port 21 but not trying that port when accessing the session from script

The session is setup for port 21 standard FTP protocol. When saving the session and using the session name in script, WinSCP is trying to access SFTP and port 22. I am unsure what is causing this issue. Any ideas? Thanks!

> 2018-06-26 09:37:04.504 Script: OPEN TCPFTPT
. 2018-06-26 09:37:04.504 --------------------------------------------------------------------------
. 2018-06-26 09:37:04.504 Session name: TCPFTPT (Ad-Hoc site)
. 2018-06-26 09:37:04.504 Host name: TCPFTPT (Port: 22)
. 2018-06-26 09:37:04.504 User name: (Password: No, Key file: No, Passphrase: No)
. 2018-06-26 09:37:04.504 Tunnel: No
. 2018-06-26 09:37:04.504 Transfer Protocol: SFTP (SCP)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,658
Location:
Prague, Czechia

Re: Session is setup for port 21 but not trying that port when accessing the session from script

I cannot really say, as you didn't attach a full log file, that I've asked you for.
But I guess that your script does not use the same configuration as your GUI.
This may help you:
https://winscp.net/eng/docs/faq_scheduler

Reply with quote

dms
Joined:
Posts:
3
Location:
North Carolina

log file attached

Martin,
I have attached the log file. I read thru the link you provided. I check the host keys and the site is setup there. The attached file contains multiple transmission open calls.
All worked but the TCPFTPT site. Thanks!

Tad

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,658
Location:
Prague, Czechia

Re: log file attached

WinSCP does not know any TCPFTPT site. So I'm pretty sure that the FAQ I've linked previously explains the problem:
The connection fails, because your script depends on site, which is not known by the service’s account; or the local account that runs the service does not have a network access.
...
Configure your session completely using open command, using session URL (and raw session settings, if needed), instead of storing site.

  • Good practice is to develop your scripts with configuration isolated from GUI.
  • Alternatively use INI file instead of registry to store the configuration to make sure the site (and/or other settings) can be accessed by all accounts.
Follow the link for more details.
https://winscp.net/eng/docs/faq_scheduler

Reply with quote

Advertisement

You can post new topics in this forum