#author("2017-02-06T23:32:35+09:00","default:Authors","Authors")
''[[TopPage]]''

* TeraTermマクロでログイン、ログ記録、コマンド発行 [#rd9259a6]
どのようなプロジェクトでもあると便利なものです。~
毎度作ろうとすると面倒なので、コピペして使うと効率的でしょう。~

** 関連ページ [#mc23b205]
~

ファイル名: 任意.ttl
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 username = 'WWWWWWWW'
 hostname = 'XX-XX-01'
 password = 'YYYYYYYYYY'
 logdir = 'C:\Users\ZZZZZZZZZZ\Desktop\'
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 strconcat msg hostname
 strconcat msg ':22 /ssh /2 /auth=password /user='
 strconcat msg username
 strconcat msg ' /passwd='
 strconcat msg password
 
 connect msg
 
 msg = logdir
 strconcat msg hostname
 getdate datetime '_%Y%m%d_'
 strconcat msg datetime
 strconcat msg '.log'
 logopen msg 0 1
 
 wait '$ '
 sendln 'su -'
 wait ':'
 sendln password
 wait '# '
 sendln 'uname -n'
 wait '# '
 sendln 'date'
 wait '# '
 sendln 'id'
 wait '# '
 sendln 'pwd'
 wait '# '
 
 unlink
 
 hostname = 'XX-XX-02'
 msg = hostname
 strconcat msg ':22 /ssh /2 /auth=password /user='
 strconcat msg username
 strconcat msg ' /passwd='
 strconcat msg password
 
 connect msg
 
 msg = logdir
 strconcat msg hostname
 getdate datetime '_%Y%m%d_'
 strconcat msg datetime
 strconcat msg '.log'
 logopen msg 0 1
 
 wait '$ '
 sendln 'su -'
 wait ':'
 sendln password
 wait '# '
 sendln 'uname -n'
 wait '# '
 sendln 'date'
 wait '# '
 sendln 'id'
 wait '# '
 sendln 'pwd'
 wait '# '
 
 unlink
 
 end

*** 参考ページ [#o70b9eba]
~


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS