tail -f 使用 PuTTY 挂起 [英] tail -f using PuTTY hangs

查看:102
本文介绍了tail -f 使用 PuTTY 挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PuTTY 命令行连接到服务器并跟踪日志文件.在本地机器上,我创建了一个文件tail-exec",其中包含以下文本:

I am using PuTTY command line to connect to a server and tail a log file. On local machine I've created a file "tail-exec" which contains following text:

tail -f/var/log/test.log

我通过命令行启动腻子:

I am starting putty through command line as:

putty -ssh -t -pw -m tail-exec user@server

这会打开带有日志尾部的终端窗口.但是问题是,在日志中添加了几百行之后,这个终端就挂了.

This opens up the terminal window with log tail. But the problem is that this terminal hangs after there are few hundred lines added to the log.

如果我手动打开 putty,然后从 bash 提示符运行 tail 命令,那么它也不会挂上数千行.

If I open putty manually, and then run the tail command from the bash prompt, then it is not hanging for thousands of lines also.

我尝试在 tail-exec 文件中使用以下文本,但发生了同样的问题:

I've tried using following text in tail-exec file, but same issue is happening:

bash -i tail -f/var/log/test.log

知道可能是什么问题吗?

Any idea what could be the issue?

推荐答案

尝试使用设置了Keepalive"选项的已保存会话.像这样使用会话:

Try to use a saved session where you set the Option "Keepalive". The use the session like this:

putty -ssh -t -pw -m tail-exec -load 'session-name'

这篇关于tail -f 使用 PuTTY 挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆