Hi All,
I am trying to create a TI which will place a text file from data directory to an external SFTP server to be used by Database team. The database team has provided the host name, port number, file protocol(SFTP), userid/pwd to connect to the location to place the file. Can someone please guide me how should I write the TI? I am not looking for exact code but if someone can suggest some approach and functions, then It will be of great help. The files might need to be placed using batch files I guess. This is the first time I got such request in my project, so not sure how to achieve this. Thanks!!!
TI for placing a file on SFTP server
-
- Posts: 28
- Joined: Wed Jan 18, 2017 3:27 pm
- OLAP Product: Cognos TM1
- Version: 10.2.2, 11
- Excel Version: Excel2010
- Location: Bangalore, India
TI for placing a file on SFTP server
Regards,
Amit Saxena
India
Amit Saxena
India
-
- Community Contributor
- Posts: 287
- Joined: Fri Feb 15, 2013 5:49 pm
- OLAP Product: TM1
- Version: PA 2.0.9.1
- Excel Version: 365
- Location: Minneapolis, USA
Re: TI for placing a file on SFTP server
You could use a tool like WinSCP to do the transfer. You can write a script for that program that can be called from a TI process in the same way that you'd call a .bat file.
- macsir
- MVP
- Posts: 785
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: TI for placing a file on SFTP server
I would recommend to use Powershell to call winSCP.
https://stackoverflow.com/questions/387 ... powershell
https://stackoverflow.com/questions/387 ... powershell
-
- Posts: 28
- Joined: Wed Jan 18, 2017 3:27 pm
- OLAP Product: Cognos TM1
- Version: 10.2.2, 11
- Excel Version: Excel2010
- Location: Bangalore, India
Re: TI for placing a file on SFTP server
I created the below batch file and executed it through TI.
*********************
@ECHO On
set _datetime=%date%_%time%
set sftpascii=%1
set sftplog="E:\DataDirectory\log.txt"
echo ------------------------------------------------------- >> %sftplog%
echo %_datetime% >> %sftplog%
echo sending %sftpascii% >> %sftplog%
"C:\Program Files (x86)\Bitvise SSH Client\sftpc.exe" Username:Password@ServerHostName:22027 -pk=g1 -cmdfile=%sftpascii% >> %sftplog%
echo ------------------------------------------------------- >> %sftplog%
********************
Here sftpascii is the text file being passed in ExecuteCommand function in TI which has below code:
cd /Recon/
put -o "E:\cognos\FilePath\RECON_20180611233832.csv"
chmod 666 RECON_20180611233832.csv"
quit
but the below error is thrown in sftplog while executing the TI:
---------------------------------------
Fri 06/15/2018_ 3:23:57.02
sending "E:\cognos\FilePath\RECON_20180611233832.csv"
Bitvise SSH Client 7.31 - sftpc - free of charge for use in all environments
Copyright (C) 2000-2017 by Bitvise Limited.
Connecting to SSH2 server ServerHostName:22027.
Connection established.
Server version: SSH-2.0-1.82_sshlib TargetServerName
First key exchange started. Cryptographic provider: Windows CNG (x86) with additions
ERROR: The SSH2 session has terminated with error. Reason: Error class: LocalSshDisconn, code: KeyExchangeFailed, message: FlowSshTransport: no mutually supported inbound encryption algorithm. Local list: aes256-gcm,aes256-ctr,aes192-ctr,aes128-gcm,aes128-ctr,3des-ctr. Remote list: twofish256-cbc,aes256-cbc,twofish-cbc,3des-cbc,twofish128-cbc,aes128-cbc,cast128-cbc,blowfish-cbc,arcfour.
-------------------------------------
How can I resolve this error?
Regards,
Amit Saxena
India
Amit Saxena
India
- macsir
- MVP
- Posts: 785
- Joined: Wed May 30, 2012 6:50 am
- OLAP Product: TM1
- Version: PAL 2.0.9
- Excel Version: Office 365
- Contact:
Re: TI for placing a file on SFTP server
google is your friend. https://serverfault.com/questions/78557 ... th-cuteftp
If you can't fix it, you still could try winscp.
If you can't fix it, you still could try winscp.