从putty提取日志 [英] Extract Logs from putty

查看:2417
本文介绍了从putty提取日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有办公室的日常工作。有一些日志文件是使用java应用程序在Web和应用程序服务器上创建的。我必须登录putty。然后我必须登录服务器。之后,我必须去某个路径。然后提取一些日志文件,它们是.txt文件。然后,我必须去windows的命令提示符,并将由putty提取的日志文件保存到本地机硬盘。

I have daily task to do in office. There are some log files which are created on web and app server using java applications. I have to log in to putty. Then i have to login to server. After that i have to go to certain path. And then extract some logs file which are .txt files. And then after I have to go to command prompt in windows and save the log files extracted by putty to local machine hard disk.

我想自动执行此任务。是否可以在putty中编写过程/脚本来执行此任务?

I want to automate the task of doing this. Is it possible to write procedure/script in putty to do this task? Please point me to resources or any help will be appreciated.

推荐答案

我想你可以用plink做到这一点,我想它会捕获stdout到你的终端,不要引用我,虽然。我现在不能测试你,因为我只有一个Linux机器。

I think you can do this with plink, I think it will capture stdout to your terminal, don't quote me on that though. I can't currently test for you as I only have a Linux machine to hand.

plink user@host cat /path/tofile/log.log > c:\log.txt

如果没有得到一个合适的SFTP客户端,需要。

If not get a proper SFTP client which should let you do what you need.

如果你得到基本案例工作,我建议拉取档案和本地提取。它会更快,因为文本压缩好,将更容易控制输入/输出文件名。

IF you get the basic case working I'd recommend pulling the archives and extracting locally. It will be faster as text compresses well and it will be easier to control input/output filenames.

这篇关于从putty提取日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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