Files
huike-back/run_rotate.sh
weli 0e53c9f66d feat(htykc): clazz completed_at migration; logrotate for htykc/htyproc/htyts
Portable run_rotate; moicen_start_huiwings_stack and ws_clazz updates; schema/models sync.

Made-with: Cursor
2026-04-26 17:14:44 +08:00

23 lines
897 B
Bash
Executable File

#!/usr/bin/env bash
# 与旧机 `su alchemy -c "/mnt/huiwing/huiwing/run_rotate.sh"` 等价:对各 crate 目录下
# logrotate.config 执行 logrotate(状态文件各目录独立 ./logrotate.status)。
# 本脚本位于 huike-back 根;默认 monorepo 为上一级(含 AuthCore、huike-back)。
# 可覆盖:export HUIWING_REPO=/path/to/huiwing-migration
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO="${HUIWING_REPO:-$(cd "$SCRIPT_DIR/.." && pwd)}"
AUTH="${HUIWING_AUTH:-$REPO/AuthCore}"
rotate_one() {
local dir="$1"
[ -d "$dir" ] || return 0
[ -f "$dir/logrotate.config" ] || return 0
( cd "$dir" && /usr/sbin/logrotate -s ./logrotate.status ./logrotate.config )
}
rotate_one "$AUTH/htyuc"
rotate_one "$REPO/huike-back/htyws"
rotate_one "$REPO/huike-back/htykc"
rotate_one "$REPO/huike-back/htyts"
rotate_one "$REPO/huike-back/htyproc"