ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

QSH & SFTP to another server

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • QSH & SFTP to another server

    Hi guys, I have to replace the current transfers from AS400 to another server, I don't know if it is an AS400 or another type, doesn't matter.
    Currently, the program who makes the transfer has this input file with commands:

    user_name password
    NAMEFMT 1
    SENDPASV 1
    cd Folder/Root/folder1/folder2
    put /QSYS.lib/my_library.lib/My_file.file/Member1.mbr File_sent.txt
    close
    quit


    Can you explain me how I have to do to convert all these commands to run under QSH?
    I know that I need an user profile with public key to be able to connect to the remote system with key authentication and I have to run the commands for transfer under QSH on AS400 with a script file stored into the IFS under the user directory
    but the question now.. I don't know if I can put all these commands in the script file in IFS and after run in QSH the commands sftp -b /sftp_user/script_file name_serverUserID@server?
    It support all FTP commands? like NAMEFMT 1, SENDPASV 1, change directory because I have to send the files in the same location, but under SFTP.

    Thanks in advance

  • #2
    Guys, sorry to insist.. but please clarify me.. I found that I can use in the file script for SSH the change directory command, with this point is it ok but with the others 2 commands, namefmt and sendpasv? can you help me? how can I migrate to can be executed by ssh

    Comment


    • #3
      NAMEFMT is not standard FTP, it only exists on IBM i, nowhere else. SFTP does not have a name format, it always uses IFS format (the same as namefmt 1 in old-style FTP).

      SENDPASV doesn't make any sense in SFTP. This has to do with the internals of how the FTP network protocol works. Since SFTP doesn't use that protocol, it makes no sense to try to use it.

      Comment


      • #4
        One question please, until now I implemented and ran several process with a new clle program for SFTP developed who use QSH inside to run the command sftp -b /dir/input.txt user@hostname... with the input file stored in the IFS directory and also with the data file to be transferred stored in the IFS directory, the file specified in the input file...but now, I am wondering if it is possible to send files directly from DB2, not from IFS? something like ftp process? or it is mandatory to copy the DB2 file into IFS such stream file to be able to send under sftp/ssh?
        Thank you.

        Comment

        Working...
        X