diff --git a/core/mod_google.sh b/core/mod_google.sh index efeec61..62a727b 100755 --- a/core/mod_google.sh +++ b/core/mod_google.sh @@ -27,7 +27,8 @@ if ! type log >/dev/null 2>&1; then # 日志格式注入 [版本号] 追踪标识 local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$2" "$1" "$REGION_CODE" "$3") - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log" + # [时区对齐] 强制无视本地时区,以绝对 UTC 时间写入日志 + echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log" # 强制推送到 Systemd Journal (如果系统支持) if command -v logger >/dev/null 2>&1; then diff --git a/core/mod_quality.sh b/core/mod_quality.sh index 1cba784..3857f6f 100755 --- a/core/mod_quality.sh +++ b/core/mod_quality.sh @@ -190,7 +190,8 @@ fi # 7. 组装情报级 Markdown 战报 # 提取本地运行态版本与生成时间戳 LOCAL_VER="${AGENT_VERSION:-未知}" -CURRENT_TIME=$(date "+%Y-%m-%d %H:%M:%S") +# [时区对齐] 深海声呐战报落款强制采用绝对 UTC 时间 +CURRENT_TIME=$(date -u "+%Y-%m-%d %H:%M:%S UTC") # [体验修复] 探针返回的 IP 带有星号掩码,强制使用中枢下发的真实 IP 拼接,以防直达链接失效! LINK_IP=$(echo "$PUBLIC_IP" | tr -d '[]') diff --git a/core/mod_trust.sh b/core/mod_trust.sh index b7ea134..e414821 100755 --- a/core/mod_trust.sh +++ b/core/mod_trust.sh @@ -45,7 +45,8 @@ fi log_msg() { local TYPE=$1 local MSG=$2 - local TIME=$(date "+%Y-%m-%d %H:%M:%S") + # [时区对齐] 强制无视本地时区,以绝对 UTC 时间生成日志时间戳 + local TIME=$(date -u "+%Y-%m-%d %H:%M:%S UTC") # [v3.4.0 核心] 提取当前配置中的版本锚点 local local_ver="${AGENT_VERSION:-未知}" diff --git a/core/runner.sh b/core/runner.sh index 798958d..afdf4c9 100755 --- a/core/runner.sh +++ b/core/runner.sh @@ -36,7 +36,7 @@ log() { # 日志格式注入 [版本号] 追踪标识 local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$level" "$module" "$REGION_CODE" "$msg") - echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "$LOG_FILE" + echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "$LOG_FILE" # 强制推送到 Systemd Journal (如果系统支持) if command -v logger >/dev/null 2>&1; then