cron실행시..
작성자 정보
- 전광석 작성
- 작성일
컨텐츠 정보
- 824 조회
- 0 추천
- 목록
본문
[root@localhost ip_]#cat ipget
#!/usr/bin/expect
spawn telnet 10.10.10.10
expect "Password:
"
send "password1
"
send "en
"
expect "Password:
"
send "password2
"
send "term len 0
"
send "show run | i ip rou
"
send "exit
"
interact
[root@localhost ip_]#
위의 것을 그냥 실행시키면 결과가 제대로 나옵니다.
[root@localhost ip_]# ./ipget
spawn telnet 10.10.10.10
Trying 10.10.10.10...
Connected to 10.10.10.10
Escape character is '^]'.
User Access Verification
Password:
RouterA>en
Password:
RouterA#term len 0
RouterA#show run | i ip rou
ip router isis
ip route-cache distributed
ip router isis
ip route-cache distributed
ip route 61.74.250.0 255.255.255.0 168.126.226.9 tag 9120
....중략...
ip route 220.76.146.0 255.
ip route 220.76.147.0 255.
RouterA#exit
Connection closed by foreign host.
[root@localhost ip_]#
그런데 cron으로 실행시킬 경우에는
09 17 * * * /daily_job/ip_/ipget > /tmp/ttt
[root@localhost /tmp]# cat ttt
spawn telnet 10.10.10.10
Trying 10.10.10.10...
Connected to 10.10.10.10.
Escape character is '^]'.
User Access Verification
Password:
RouterA>en
Password: [root@localhost /tmp]#
결과가 나오다 마네요. 이래 저래 해봐도 계속 마찬가지고.. 원인이 너무 궁금합니다.
관련자료
-
이전
-
다음