Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

According to, you can simply set timeout to -1 to disable the timeout mechanism.

share|improve this answer
excellent thank you. – aHunter Nov 21 '10 at 4:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.