Files
inquiry_robot/deploy/Watch-Agent8910.同事说明.txt
T

39 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
同事如何使用「Watch-Agent8910」(只读盯服务器 8910 日志)
一、需要具备
1. Windows + 已安装 OpenSSH 客户端(Win10/11 一般自带 ssh/scp)
2. 仓库里这两个文件(或单独拷贝 deploy 目录):
- Watch-Agent8910.ps1
- Watch-Agent8910.bat(可选 Once 版:Watch-Agent8910-Once.bat)
3. 能登录测试机的 SSH 私钥,且账号已加入服务器授权
二、本机配置密钥(二选一)
A. 默认路径(与现网脚本一致)
把私钥放到:%USERPROFILE%\.ssh\id_ed25519_ytd
(无扩展名;权限保持仅自己可读)
B. 自定义路径
运行前设置环境变量,例如:
set YTD_SSH_KEY=D:\keys\my_ytd_ed25519
set YTD_SSH_HOST=ytd_extdev_0903@129.211.181.80
三、怎么跑
- 双击 Watch-Agent8910.bat → 持续监听(Ctrl+C 结束)
- 双击 Watch-Agent8910-Once.bat → 只看最近一段
- 或命令行:
Watch-Agent8910.bat
Watch-Agent8910.bat -Once
Watch-Agent8910.bat -Access
本机同时落盘(仓库根目录 logs/,按当天日期追加写入):
logs/20260913_info.log
logs/20260913_error.log
不要提交 logs/ 到 Git。
四、注意
- 这是只读拉日志,不会改 Nginx / 不会切流
- 私钥不要发到微信群或提交 Git;向负责人单独要密钥或加自己的公钥到服务器
- 若提示禁止运行脚本:用 bat 即可(已带 Bypass),不要直接右键用受限策略跑 ps1
- 乱码时用:Watch-Agent8910.bat -Gbk
- 只要屏幕不要文件:Watch-Agent8910.bat -NoLocalLog