I am using EXPECT to send data to a partner that requires userid/password authentication. Here is my script:
#!/usr/local/bin/expect -f
log_file -noappend /ford/log.log
spawn sftp aidistributors@xxxxxxxxx.com
expect {
default {exit 10}
"password:"
}
send "********"
expect {
default {exit 20}
"sftp> "
}
send "lcd /ford\n"
expect {
default {exit 30}
"sftp> "
}
send "mput FORD*.TXT\n"
sleep 60
expect {
default {exit 40}
"sftp> "
}
send "quit\n"
exit 0
This works most of the time. But occasionally the only thing in my log is the initial command "spawn sftp aidistributors@dstftp2.dstinc.com", the script ends and the message "QShell command failed with status 0000000010 and signal 0000000000 " is sent.
I have spoken with my partner and am told there is no record in their logs that a connection attempt was made. Is there a way I can determine what, if anything, was received from my attempt to make the connection?
Thanks in advance.
#!/usr/local/bin/expect -f
log_file -noappend /ford/log.log
spawn sftp aidistributors@xxxxxxxxx.com
expect {
default {exit 10}
"password:"
}
send "********"
expect {
default {exit 20}
"sftp> "
}
send "lcd /ford\n"
expect {
default {exit 30}
"sftp> "
}
send "mput FORD*.TXT\n"
sleep 60
expect {
default {exit 40}
"sftp> "
}
send "quit\n"
exit 0
This works most of the time. But occasionally the only thing in my log is the initial command "spawn sftp aidistributors@dstftp2.dstinc.com", the script ends and the message "QShell command failed with status 0000000010 and signal 0000000000 " is sent.
I have spoken with my partner and am told there is no record in their logs that a connection attempt was made. Is there a way I can determine what, if anything, was received from my attempt to make the connection?
Thanks in advance.
Comment