alapa...@gmail.com <
alapa...@gmail.com> wrote:
> On Tuesday, January 3, 2017 at 4:04:54 AM UTC+5:30,
alapa...@gmail.com wrote:
>> spawn ssh -o StrictHostKeyChecking=no $user@$device
>> expect "password:"
>> send "$pass\n"
>> send "\n"
>> expect ">"
>> send "en\n"
>> expect "Password:"
>> send "$enpass\n"
>> expect "#"
>> log_file /var/lib/tftpboot/$device/$device-$date.txt
>> send "term len 0\n"
>>
>> Error is below mentioned !!!
>>
>> send: spawn id exp6 not open
>> while executing
>> "send "term len 0\n""
>> (file "/usr/local/sbin/qbackup1" line 24)
> please help on any one !!!!! urgent basics
I'd guess that the ssh command already died away, when this error arrives.
Is there a noticeable delay between starting the script and this error
occurring, or does it fail "instantly"?
Maybe the target's output differs a bit from what you expect.
Maybe you need to pass little delays before sending data. The target
might flush its input right *after* writing the prompt, so if you
immediately write after seeing the prompt, your data might be lost.
Does the log file contain anything interesting?