tail -f using PuTTY hangs

笑着哭i 提交于 2019-12-08 02:45:05

问题


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.

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.

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?


回答1:


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'


来源:https://stackoverflow.com/questions/3545611/tail-f-using-putty-hangs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!