how many "e"s can you find in:
q: linux expect script terminates too early i have an expect script that i have written that at the end calls scp to copy a large file from server a to server b.
the issue i have (which is the same using rsync and not scp) is that the expect script is terminating before the file transfer is complete. i know that i can set the timeout in expect but as the file size grows so will the timeout.
is there anyone that has come across this issue and is there a wait function that i can use in expect?
many thanks. 

a: according to http://oreilly.com/catalog/expect/chapter/ch03.html, you can simply set timeout to -1 to disable the timeout mechanism.

a: two things, number one, yes, set timeout -1 if you do not want it to timeout.
secondly, you should use wait to allow the scp or rsync command to complete. simply waiting forever is not nearly as robust...
last comment, i was an scp user for quite some time but have really grown to love the delta, partial and sparse abilites of rsync. with these, even if the transfer is disconnected, it can pick back up where it left off which is immensely helpful at times....especially if waiting forever anyway ;)
something like:
rsync -a -v -i --timeout=30 --stats --log-file="$log_file" --partial --exclude 'log*.txt' "$data_dir"/"$date" $dest:"$dest_dir"

(this pushes from the node to the master)
doing this can save some serious bandwidth when transferring large files, spotty networks, etc...

user
There are one hundred and thirty-three "e"s.
assistant