# hqmonitor **Repository Path**: Crazylight/hqmonitor ## Basic Information - **Project Name**: hqmonitor - **Description**: future异动监控 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-11 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #### 软件架构 DIC_PATH = 'E:\\HQData\\RawData\\' DIC_PATH = '/data/hqdata/' #### 安装教程 yum install git #### 使用说明 simple forking # 后台运行模式 #### 常用操作 ### 登录服务器 ssh root@120.48.47.249 ### Git操作 git clone https://gitee.com/Crazylight/monitor.git git clone -b develop https://gitee.com/Crazylight/monitor.git git fetch --all # 拉取所有远程更新 git reset --hard origin/master # 将本地代码重置到远程仓库的状态 git pull # 更新本地分支 git checkout master # 切换到master分支 git switch master # 切换到master分支 git branch --show-current # 查看当前分支 #### 常用命令 ### 查看CPU使用率 top -b -n 1 | grep "Cpu(s)" ### 查看内存使用率 free -m ### 查看磁盘使用率 df -h ### 查看网络使用率 ifconfig ### 查看进程 ps -ef ### 查看端口占用 netstat -anp | grep 8080 ### 查看日志 tail -f /var/log/messages ### 查看系统信息 cat /etc/issue ### 查看系统版本 cat /etc/redhat-release ### 查看系统内核版本 uname -r ### 查看系统架构 uname -m ### 查看系统时间 date ### 查看系统时区 timedatectl ### 查看系统用户 who ### 查看系统用户登录历史 last ps aux #### 服务操作 ## 获取更新代码 ### 1. 获取 # 删掉code文件夹 直接放到home目录下 git clone -b develop https://gitee.com/Crazylight/hqmonitor.git git clone https://gitee.com/Crazylight/hqmonitor.git cd monitor git pull ### 2. 更新 journalctl -u hqmonitor.service cd /myservices/hqmonitor/ rm -rfd /myservices/hqmonitor/* rm -rfi /myservices/hqmonitor/* 全量更新 cp -r –exclude=constants.py /mnt/hqmonitor/src/* /myservices/hqmonitor ### 不用提示是否覆盖,强制更新 unalias cp cp -rf /mnt/hqmonitor/src/* /myservices/hqmonitor git reset --hard chmod a+x /myservices/hqmonitor/src/start_hqmonitorservice.sh ### 3. 启动服务 sudo systemctl daemon-reload sudo systemctl restart hqmonitor.service ### 业务文件处理 cd /var/data/hqdata/rawdata/ cd /var/log/ ### 服务文件处理 mv hqmonitor.service /etc/systemd/system/ cp hqmonitor.service /etc/systemd/system/ mv 源文件命 目标文件名 chmod a+x start_hqmonitorservice.sh cp ./docs/constantlinux.py src/common/constants.py rm -f ./common/constants.py cp hqmonitor.service /etc/systemd/system/ ###### 直接编辑 vi /usr/bin/myapp/start_hqmonitorservice.sh #### 地址设置 /myservices/hqmonitor/ 存放运行的代码; 获取代码后,放到该目录下;并且直接运行该目录下的代码即可。已经兼容linux和windows系统。 /usr/bin/myapp/ 启动项目的shell脚本 /usr/lib/systemd/system/ 存放service文件 /etc/systemd/system/ 存放service文件 /var/log/myapp/ 存放日志文件 ### 通过编写.service文件并将其放置在/etc/systemd/system/目录下 ### 启动服务 sudo systemctl daemon-reload ### 开启服务 systemctl start hqmonitor.service systemctl restart hqmonitor.service systemctl enable hqmonitor.service 创建软连接 开机时自动启动 ### 编辑服务 systemctl edit hqmonitor.service ### 查看服务状态 systemctl status hqmonitor.service sudo journalctl -xeu hqmonitor.service ### 重载服务 systemctl start hqmonitor.service ### 停止服务 systemctl stop hqmonitor.service ### 重启服务 systemctl restart hqmonitor.service ### 开启服务 /etc/systemd/system/(用于自定义服务)或/lib/systemd/system/(用于系统服务) /usr/lib/systemd/system/ ### 数据说明 tushare 数据更新时间为 16:30 # 定时任务 schedule pip install schedule sudo journalctl -xeu hqmonitor.service