Automate SFTP - SSH

This is a discussion on Automate SFTP - SSH ; Hi, I need to automate SFTP. I tried using the batch file and it works. The trick here is the file name can change daily and i would need to SFTP them as well. Is there any way of passing ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Automate SFTP

  1. Automate SFTP

    Hi,

    I need to automate SFTP. I tried using the batch file and it works.
    The trick here is the file name can change daily and i would need to
    SFTP them as well. Is there any way of passing the file name as a key/
    value pair to the sftp session. There is an option of getting a file
    in the command line itself.

    I have a similar issue when trying to use sftpg3(Tectia Client). Can
    someone please help me in guiding to automate these sftp scripts.

    Thanks,
    JS


  2. Re: Automate SFTP

    joseph.shameem@gmail.com wrote:
    > Hi,
    >
    > I need to automate SFTP. I tried using the batch file and it works.
    > The trick here is the file name can change daily and i would need to
    > SFTP them as well. Is there any way of passing the file name as a key/
    > value pair to the sftp session. There is an option of getting a file
    > in the command line itself.
    >
    > I have a similar issue when trying to use sftpg3(Tectia Client). Can
    > someone please help me in guiding to automate these sftp scripts.
    >
    > Thanks,
    > JS
    >

    scp is probably what you want:

    scp somefile someuser@remote_host:/path/to/where/you/want/file/put

    Using a pair of keys, with no passsphrase, automation is then trivual

  3. Re: Automate SFTP

    Ref: <1181666132.600572.92010@j4g2000prf.googlegroups.co m> de
    joseph.shameem@gmail.com
    >Hi,
    >
    >I need to automate SFTP. I tried using the batch file and it works.
    >The trick here is the file name can change daily and i would need to
    >SFTP them as well. Is there any way of passing the file name as a key/
    >value pair to the sftp session. There is an option of getting a file
    >in the command line itself.




    local_filename=""
    remote_filename=""
    echo "get $remote_filename $local_filename" | sftp @

    (TIMTOWTDI)

    --
    Gilles "Cool Raoul" - http://coolraoul.cvp-net.com/

+ Reply to Thread