#!/usr/local/bin/expect -f
spawn ftp $HOSTNAME
expect "Name (sj105ut01:laureen):"
send "laureen\r"
expect "Password:"
send "password\r"
expect "ftp>"
send "cd path\r"
expect "ftp>"
send "put local_file.t.Z remote_file.t.Z"
expect "ftp>"
send "bye\n"
#interact
When I try to unzip the file on the server using (tar xzf) I get the following error:
tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting
What might be the causes of this? and is there any way to fix it?
When it starts executing the put command, I get this on the screen:
150 Opening BINARY mode data connection for remote_file.t.Z
and then I get the shell back. I suppose I should be seeing something to indicate that the transfer is complete but I'm not. sth like:
226 Transfer complete 147742720 bytes sent in 27.3 secs (5420.58 Kbytes/sec)
The size of the file: Local: 142M, while remote : 56M!
thanks
binary
mode first!!! jscape.com/blog/… – Mark Setchellexpect
timeout higher - it looks like it times out after 10s at 5MB/s tcl.tk/man/expect5.31/expect.1.html – Mark Setchell