vault backup: 2026-02-26 21:10:47

This commit is contained in:
windyboy
2026-02-26 21:10:47 +08:00
parent 1e3905d304
commit 410167d3b4
38 changed files with 3890 additions and 70 deletions
+13 -2
View File
@@ -26,8 +26,19 @@ run_memory_async_index() {
git diff-tree --no-commit-id --name-status -r -M --diff-filter=ACDMRT HEAD -- '*.md' > "$changes_file" 2>/dev/null || true
[[ -s "$changes_file" ]] || { rm -f "$changes_file"; return 0; }
nohup uv run --project "$vault_dir/.scripts/memory" python "$vault_dir/.scripts/memory/incremental_ingest.py" \
--changes-file "$changes_file" >> "$log_file" 2>&1 &
nohup bash -c "
# 日志轮转:超过 5MB 保留最后 1000 行
if [[ -f '$log_file' ]] && [[ \$(wc -c < '$log_file') -gt 5242880 ]]; then
tail -n 1000 '$log_file' > '$log_file.tmp' && mv '$log_file.tmp' '$log_file'
fi
uv run --project '$vault_dir/.scripts/memory' python '$vault_dir/.scripts/memory/incremental_ingest.py' \
--changes-file '$changes_file' >> '$log_file' 2>&1
exit_code=\$?
if [[ \$exit_code -ne 0 ]]; then
echo \"\$(date '+%Y-%m-%d %H:%M:%S') [ERROR] incremental_ingest 退出码=\$exit_code\" >> '$log_file'
fi
rm -f '$changes_file'
" &
}
run_memory_async_index
# --- memory async index hook end ---