I have an ftp statement that when it restarts, it will write over the top of the file at the other end, rather than append to the file part sitting at the destination.
This is a problem because the flaky connection fails so regularly that the 2GB file I try to transfer will never complete.
Do any of you guru's out there understand how to ensure sftp will to recognise the file part at the other end and append to it?
And while we're at it, how can I improve reliability? When I run in batch mode it dies after less then 2MB sent, however if I run from a logged in shell and run sftp off the commandline, it will survive almost 1GB before exits. Why might this be?
Here's the code so far (naturally I've got a ~/.ssh/config file that has the proxy settings of the other end, and FYI I use the "corkscrew" library for this)
#!/bin/ksh
set timeout 60
result=1
tries=0
# TODO while [[ $result -ne 0 ]] ; do
while [[ 1 -ne 0 ]] ; do
expect << EOF
spawn sftp me@host.name.com <<EOF
expect "\*password:\*"
send -- "${password}\r"
expect "sftp> "
send -- "lcd /path/to/local/file/\r"
expect "sftp> "
send -- "cd /remote/path/to/place/file/\r"
expect "sftp> "
send -- "put file_name.txt\r"
expect "sftp> "
send -- "bye\r"
EOF
result=$?
let tries+=1 ;
echo "###result:${result}:tries bottom:${tries}"
done