Connection failed when running automated script
Hej there!
I have a batch script that calls for winscp.com with a script parameter, which is executed by a service account via scheduled task. The svc account can successfully execute the script interactively, but fails to establish connection to FTP servers when run in background.
A restart of the servers solves the matter for a couple of days and then it starts to fail.
Task:
Script:
WinSCP log:
Running interactively under svc user or any other the WinSCP log looks the same, but the connection is established. I have to note, that the application owner has told me that such an issue is *come and go* even when it was running on w2k8 r2. Any assistance would be appreciated.
I have a batch script that calls for winscp.com with a script parameter, which is executed by a service account via scheduled task. The svc account can successfully execute the script interactively, but fails to establish connection to FTP servers when run in background.
A restart of the servers solves the matter for a couple of days and then it starts to fail.
Task:
C:\Program Files (x86)\WinSCP\WinSCP.com /script=C:\OrgUnitExport\FTPscript\sync.txt /log=C:\OrgUnitExport\RunSync\WinSCP.log /ini=nul
Script:
option batch abort option confirm off open ftp://USER:PASS@10.40.140.111 synchronize local C:\OrgUnitExport\ /CA_OrgData synchronize local C:\OrgUnitExport\ /CA_UserData exit
WinSCP log:
. 2017-03-28 18:36:09.518 -------------------------------------------------------------------------- . 2017-03-28 18:36:09.518 WinSCP Version 5.7.2 (Build 5316) (OS 6.3.9600 - Windows Server 2012 R2 Standard) . 2017-03-28 18:36:09.518 Configuration: nul . 2017-03-28 18:36:09.518 Log level: Normal . 2017-03-28 18:36:09.518 Local account: DOMAIN\SVC . 2017-03-28 18:36:09.518 Working directory: C:\OrgUnitExport\RunSync . 2017-03-28 18:36:09.518 Process ID: 3428 . 2017-03-28 18:36:09.518 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=572 /consoleinstance=_18192_197 "/script=C:\OrgUnitExport\FTPscript\sync.txt" "/log=C:\OrgUnitExport\RunSync\WinSCP.log" "/ini=nul" . 2017-03-28 18:36:09.518 Time zone: Current: GMT+2, Standard: GMT+1 (Romance Standard Time), DST: GMT+2 (Romance Daylight Time), DST Start: 26-03-2017, DST End: 29-10-2017 . 2017-03-28 18:36:09.518 Login time: 28. marts 2017 18:36:09 . 2017-03-28 18:36:09.518 -------------------------------------------------------------------------- . 2017-03-28 18:36:09.518 Script: Retrospectively logging previous script records: > 2017-03-28 18:36:09.518 Script: option batch abort < 2017-03-28 18:36:09.518 Script: batch abort < 2017-03-28 18:36:09.518 Script: reconnecttime 120 > 2017-03-28 18:36:09.518 Script: option confirm off < 2017-03-28 18:36:09.518 Script: confirm off > 2017-03-28 18:36:09.518 Script: open ftp://USER:***@10.40.140.111 . 2017-03-28 18:36:09.518 -------------------------------------------------------------------------- . 2017-03-28 18:36:09.518 Session name: USER@10.40.140.111 (Ad-Hoc site) . 2017-03-28 18:36:09.518 Host name: 10.40.140.111 (Port: 21) . 2017-03-28 18:36:09.518 User name: USER (Password: Yes, Key file: No) . 2017-03-28 18:36:09.518 Transfer Protocol: FTP . 2017-03-28 18:36:09.518 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec . 2017-03-28 18:36:09.518 Disable Nagle: No . 2017-03-28 18:36:09.518 Proxy: none . 2017-03-28 18:36:09.518 Send buffer: 262144 . 2017-03-28 18:36:09.518 UTF: 2 . 2017-03-28 18:36:09.518 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A] . 2017-03-28 18:36:09.518 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes . 2017-03-28 18:36:09.518 Cache directory changes: Yes, Permanent: Yes . 2017-03-28 18:36:09.518 Timezone offset: 0h 0m . 2017-03-28 18:36:09.518 -------------------------------------------------------------------------- . 2017-03-28 18:36:09.518 Connection failed.
Running interactively under svc user or any other the WinSCP log looks the same, but the connection is established. I have to note, that the application owner has told me that such an issue is *come and go* even when it was running on w2k8 r2. Any assistance would be appreciated.