# report **Repository Path**: kunpeng-app-migration/report ## Basic Information - **Project Name**: report - **Description**: 归档日志自动生成报告,发送邮件通知 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-11-20 - **Last Updated**: 2020-12-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 编译日志报告生成 #### 介绍 归档日志自动生成报告,发送邮件通知 #### 日志生成配置方法 1. 克隆此仓库到本地 2. 为服务器URL提示创建配置文件 generate/config.json,如下: ```json { "address": "http://example.com/archive_path/" } ``` #### 日志发送配置方法 1. 克隆此仓库到本地(如已克隆,可忽略) 2. 为解决方案、收件人创建配置文件 dispatch/config.json,如下: ```json { "SolutionName1": { "receiver":[ "receiver1@example.com", "receiver2@example.com" ], "cc_receiver":[ "cc1@example.com", "cc2@example.com" ] }, "SolutionName2": { "receiver":[ "receiver1@example.com", "receiver2@example.com" ], "cc_receiver":[ "cc1@example.com", "cc2@example.com" ] }, "SolutionName3": { "receiver":[ "receiver1@example.com", "receiver2@example.com" ], "cc_receiver":[ "cc1@example.com", "cc2@example.com" ] } } ``` #### 使用教程 手动执行: 1. 执行 generate/gen_report.py [date] 以生成报告等。日期格式为YYYYMMDD,如20201207。 2. 执行 dispatch/send_report.py [date] 以发送邮件通知。日期格式为YYYYMMDD,如20201207。 自动定时执行: 1. 修改reportsend.service与report_generate_dispatch.sh,使绝对路径正确匹配,并修改reportsend.timer设置定时发送时间 2. 复制reportsend.service与reportsend.timer到/usr/lib/systemd/system/内 3. 使用systemctl启用reportsend.service与reportsend.timer,将在定时时间自动生成、发送本日报告