开发者

What's an easy way to automate logging into a server and tailing a log?

I would like to save the keystrokes I make to ssh into a server (with a开发者_运维问答 ssh public key) and tail a log file. What's the easiest way to do this. Is there a shell script that can do this, or if not, a short Ruby script?


Any reason not to use ssh itself ? ssh server "tail logfile" ?

Or if it's more complicated 'expect' is good for scripting interactive commands.


You can pass a command to the ssh command, instead of starting a shell. (Just add the command after the hostname)

Then it's easy to setup an alias for that ssh command.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜