I have a SFTP Connection that I am able to connect to via Core directly but when I try to connect from a BAT File I cannot connect and get the following error message.
10/11/17 11:41
Looking up host "stgostkftp02.overstock.com"
Connecting to 173.241.145.101 port 10022
Server version: SSH-2.0-mod_sftp/0.9.8
Using SSH protocol version 2
Version: SSH-2.0-PuTTY_Local:_Mar_21_2012_22:10:22
Diffie-Hellman group exchange
Diffie-Hellman key exchange SHA-256
Disconnected: User aborted at host key verification
Can't establish connection --> stgostkftp02.overstock.com:10022 @ Wed Oct 11 11:41:01 2017
(10038-1)Connection Failedsent 2, recd 2
Total uploaded files: 0
Total uploaded data: 0
Total downloaded files: 0
Total downloaded data: 0
Below is the command line in my BAT File to connect:
"C:\PROGRA~1\COREFTP\COREFTP.EXE" -O -s -site Overstock_Prod -d /outgoing/* -p C:\EDI_FTP\TMP\ -log C:\EDI_FTP\TOOLS\FTPLOG.TXT
SFTP not connecting from BAT Job
-
- Site Admin
- Posts: 1001
- Joined: Mon Mar 24, 2003 4:37 am
Not from a bat but from .Net
CoreFTP version 2.2 build 1910 (LE Version)
I'm trying to run it from .net 4.5. I'm not getting any errors (or anything useful from the output directive) but the file is not appearing on the server either. Here is my code (sort of) (the profile has a windows SSL certificate assigned to it and is using AUTH TLS):
appname = "D:\Programs\coreftp.exe
args = " -s -O -site Server_QA -u \\machine\docs\test.txt -p / -output \\machine\docs\corelog1.txt"
standOut = String.Empty
AddHandler objProcess.OutputDataReceived, AddressOf process_OutputDataReceived
' Start the Command and redirect the output
objProcess.StartInfo.UseShellExecute = False
objProcess.StartInfo.RedirectStandardOutput = True
objProcess.StartInfo.CreateNoWindow = True
objProcess.StartInfo.RedirectStandardError = True
objProcess.StartInfo.Domain = "mydomain"
objProcess.StartInfo.UserName = "administrator"
objProcess.StartInfo.Password = New System.Security.SecureString
For Each chr As Char In pwd.ToCharArray()
objProcess.StartInfo.Password.AppendChar(chr)
Next
objProcess.StartInfo.FileName() = AppName
If args.Length > 0 Then
objProcess.StartInfo.Arguments() = args
End If
objProcess.Start()
objProcess.BeginOutputReadLine()
objProcess.WaitForExit() 'Set to run for 20 minutes
If objProcess.HasExited() Then
strOutput = standOut
strError = objProcess.StandardError.ReadToEnd()
If strOutput IsNot Nothing AndAlso strOutput.Length > 0 Then
PersonalDetailLog(strOutput)
End If
If strError IsNot Nothing AndAlso strError.Length > 0 Then
Throw New ApplicationException(strError)
End If
Else
PersonalDetailLog("The " + AppName + " Process has exceeded the 20 minute time out is is being closed")
If objProcess.Responding Then
objProcess.CloseMainWindow()
If Not objProcess.HasExited() Then
objProcess.Kill()
End If
Else
objProcess.Kill()
End If
Throw New ApplicationException("" + AppName + " Process Time Limit Exceeded.")
End If
I'm trying to run it from .net 4.5. I'm not getting any errors (or anything useful from the output directive) but the file is not appearing on the server either. Here is my code (sort of) (the profile has a windows SSL certificate assigned to it and is using AUTH TLS):
appname = "D:\Programs\coreftp.exe
args = " -s -O -site Server_QA -u \\machine\docs\test.txt -p / -output \\machine\docs\corelog1.txt"
standOut = String.Empty
AddHandler objProcess.OutputDataReceived, AddressOf process_OutputDataReceived
' Start the Command and redirect the output
objProcess.StartInfo.UseShellExecute = False
objProcess.StartInfo.RedirectStandardOutput = True
objProcess.StartInfo.CreateNoWindow = True
objProcess.StartInfo.RedirectStandardError = True
objProcess.StartInfo.Domain = "mydomain"
objProcess.StartInfo.UserName = "administrator"
objProcess.StartInfo.Password = New System.Security.SecureString
For Each chr As Char In pwd.ToCharArray()
objProcess.StartInfo.Password.AppendChar(chr)
Next
objProcess.StartInfo.FileName() = AppName
If args.Length > 0 Then
objProcess.StartInfo.Arguments() = args
End If
objProcess.Start()
objProcess.BeginOutputReadLine()
objProcess.WaitForExit() 'Set to run for 20 minutes
If objProcess.HasExited() Then
strOutput = standOut
strError = objProcess.StandardError.ReadToEnd()
If strOutput IsNot Nothing AndAlso strOutput.Length > 0 Then
PersonalDetailLog(strOutput)
End If
If strError IsNot Nothing AndAlso strError.Length > 0 Then
Throw New ApplicationException(strError)
End If
Else
PersonalDetailLog("The " + AppName + " Process has exceeded the 20 minute time out is is being closed")
If objProcess.Responding Then
objProcess.CloseMainWindow()
If Not objProcess.HasExited() Then
objProcess.Kill()
End If
Else
objProcess.Kill()
End If
Throw New ApplicationException("" + AppName + " Process Time Limit Exceeded.")
End If
-
- Site Admin
- Posts: 1001
- Joined: Mon Mar 24, 2003 4:37 am