Skip to Content
0
Former Member
Mar 28, 2006 at 02:17 PM

shell scripting for sftp command

536 Views

Guy's

you may wondering how i can ask these question in this forum,actually it's related to abap,we have create

unix script that will upload file from remote sftp server

and put it into AL11 transcation (take any location from

your point of view),but instead of using shell script

that is having ftp the want to go for sftp,for your undersatnding following thing's i am working with

<b>Tcode</b>:sm69,sm49

<b>function module</b>:SXPG_COMMAND_EXECUTE

script that need to have sftp instead of ftp

  1. Connecting to ftp server to get the file on the current server

SOURCE_FILE_NAME=TSPAR_`date +%Y%m%d`.txt

TARGET_FILE_NAME=TSPAR_`date +%Y%m%d`.txt

cd /interf/torrance/TCW/FI

ftp -nv << EOF

open 10.252.8.73

user sanju sanju

cd /home/sanju

get $SOURCE_FILE_NAME

EOF

cp SOURCE_FILE_NAME TARGET_FILE_NAME

rm SOURCE_FILE_NAME

<b>note:</b>above script is working ,but we want' sftp not ftp

don't try above script as such,because value's are

changed for sake of security