Spawn Rsync Expect Timeout!

So you’ve written a bash script to do a rsync backup, but the script times out?

Scratching your heading trying to figure out what the issue is?

Well, if you are using expect to auto-insert your SSH password, then expect will timeout as it is not receiving any response.

You can set the timeout (in seconds) as such

set timeout 60

That will set the script to time out after 60 seconds if expect has received no trigger.

Setting the timeout to -1 will cause the ‘except’ script to never timeout, hence you’re RSYNC backup will execute and not fail due to an expect timeout.

Comments are closed.