Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

shell scripting for sftp command

Former Member
0 Kudos

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

1 REPLY 1

former_member181966
Active Contributor
0 Kudos

Try to execute same command using your OS .

ksh + x ( is for debugging ) shell script and see where its failing . I also did the same thing in last project as i have written 5 different shell scripts , for backup , append file , sending file to FTP location and then create email ...

Hope this’ll help you

Thanks