Problem While doing Sftp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sivashanmugam
    New Member
    • Feb 2009
    • 5

    Problem While doing Sftp

    Hi Friends,

    I tried to send some zips from local to remote location but the transfer is not sucess i can transfer the zips partially can some one assist me how to make it
    as sucess

    i had used the below code
    Code:
    #!/bin/sh
    
    /usr/local/bin/expect <<EOF
    
    spawn  sftp [I]USERNAME[/I]@[I]IPADDRESS[/I]
    expect "password:"
    send "Tgsf324a \r"
    expect "sftp> "
    send "cd /nas_ftp5/Customer/Troy/tbscclm/tmp/BSSFtp \r"
    expect "sftp> "
    send "lcd /forms/bscclmsa/outdata/bsca/b2collate/its/ready \r"
    expect "sftp> "
    send "put HOV_CLM_ATT_bsc20090223010100.md5 \r"
    expect "sftp> "
    send "lcd /forms/bscclmsa/outdata/bsca/b2collate/its/ready \r"
    expect "sftp> "
    send "put HOV_CLM_ATT_bsc20090223010100.zip \r"
    expect "sftp> "
    send "ls \r"
    expect "sftp> "
    send "bye "
    EOF
    Thanks in advance
    siva
    Last edited by numberwhun; Feb 24 '09, 01:13 PM. Reason: Please use code tags. Account information removed for your protection.
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Hi,
    R u getting any error when running the script?
    Means when the file is uploaded did u get any error?
    Do the normal FTP or scp works?

    Raghu

    Comment

    • jonthysell
      New Member
      • Sep 2008
      • 8

      #3
      If you're using sftp, why not use scp: http://www.hypexr.org/linux_scp_help.php

      Comment

      Working...