Expect Script, timeouts and error checking

view full story

http://serverfault.com – I was hoping to get a little insight into an expect script that I've written. Basically we have this expect script to perform an sftp upload, key authentication is not an option, and sftp is the only method supported by our vendor, thus the need for this. I want to be able to catch timeouts and log an error code for scripting purposes. I need to: Log into sftp site Begin Transfer Detect that upload has hit 100% If upload does not hit 100% within a certain time, I want to log an error code for scripting purposes. Here is what I have so far: set timeout 10 spawn sftp [email protected] (HowTos)