File transferr using sftp  through expect is partiall

Posted on 2008-11-14
Last Modified: 2013-12-26

I am doing automated file transfer using sftp, but every time file transferr for big files is partiall

but for the small files getting transferred fine, but for the big files once it is getting bye after 19%, another time 26%, each time it is diffrent, never crosses 26%

Thanks for the help
"spawn /usr/local/bin/sftp -v $user@$host ; expect "Password\"; send \"$pass\\n\"; expect \"sftp> \" ; send \"cd $Dir2 \\n\"; expect \"sftp> \"; send \"lcd $Dir1/$tmpDir \\n\"; expect \"sftp> \"; send \"get $File1 \\n\"; expect \"sftp> \"; send \"bye \\n\"; expect eof;";

Open in new window

Question by:prakashagr
    LVL 40

    Expert Comment

    are you able to finish file transfer of bog files with interactive sftp? it could be that your network is congested and drops connections.
    LVL 2

    Author Comment

    The manual transffer of the same file is sucessfull, but when we tried through automated script for the same big file it is getting partiall transferr
    LVL 14

    Accepted Solution

    You could try "set timeout 600" ,or some other number of seconds, before the spawn.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
    The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now