Files
inspiration-collector/docs/自动任务一览.md

112 lines
7.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 栖云服务器 · 自动任务一览
> 本文档记录服务器上所有 cron 自动任务的完整配置。每次新增、修改或删除 cron 任务时,必须同步更新本文件并推送 Git。
| 项目 | 说明 |
|:---|:---|
| 位置 | `docs/自动任务一览.md` |
| 仓库 | `gitea.xybkwd.top/fxy/inspiration-collector` |
| 服务器 | 43.163.225.30ubuntu 用户) |
| 时区 | UTCcron 原生),下表已换算为**北京时间** |
| 版本 | v1.12026-06-15 新增要闻扩展栏目) |
| 更新记录 | 见文末 |
---
## 一、灵感收集器相关
| 任务 | 北京时间 | 频率 | 脚本 | 功能说明 |
|:---|:---:|:---|:---|:---|
| 每日灵感分析 | 22:30 | 每天 | `inspiration-collector/scripts/run_daily_digest.sh` | 从 Memos 提取当日灵感 → DeepSeek 分析 → Markdown → Git push。内置跨日上下文衔接标签感知分组 |
| 周报趋势分析 | 16:00 | 周日 | `inspiration-collector/scripts/run_weekly_trend.sh` | 本周灵感趋势统计 + AI 周报 → Git push |
| DeepSeek 余额 | 每整点 | 1h | `inspiration-collector/tools/deepseek_balance.py` | 查询 API 余额 → 写入 `nav/data/balance.json` |
| 待办事项提取 | 每半小时 | 30min | `scripts/extract_todos.py` | 从最新 digest 中提取 TODO 项 → 推送到 todo API |
| Obsidian 卡片同步 | 每半小时 | 30min | `inspiration-collector/scripts/sync_cards.py` | Obsidian 文库卡片双向同步 |
## 二、交易系统相关
| 任务 | 北京时间 | 频率 | 脚本 | 功能说明 |
|:---|:---:|:---|:---|:---|
| 交易日报生成 | 07:55 | 每天 | `freqtrade/scripts/daily_brief.py --date` | Freqtrade dry-run 日报 → 文件 |
| 日报推送 Gitea | 08:05 | 每天 | `beast-trader/scripts/push_brief_to_gitea.sh` | 将日报文件 commit + push 到 Gitea |
| 交易记录导出 | 每整点 | 1h | `beast-trader/scripts/export_trades.sh` | 导出 dry-run 交易记录到 Gitea |
| 交易周报 | 16:00 | 周日 | `freqtrade/scripts/daily_brief.py --weekly` | 本周交易统计周报 |
| Freqtrade 健康检查 | 每5分钟 | 5min | `beast-trader/scripts/health_check.sh` | 检测 Freqtrade 进程存活,异常发 Telegram 通知 |
## 三、资讯与简报
| 任务 | 北京时间 | 频率 | 脚本 | 功能说明 |
|:---|:---:|:---|:---|:---|
| 新闻抓取 | 03:00 / 09:00 / 15:00 / 21:00 | 6h | `scripts/fetch_news.py` | 从 RSS 源抓取国际新闻 → `nav/data/news.json` |
| 新闻摘要 | 03:30 / 09:30 / 15:30 / 21:30 | 6h | `scripts/summarize_news.py` | DeepSeek 精选摘要 → `nav/data/news_summary.json`5分类 |
| **政策 RSS 抓取** | 03:00 / 09:00 / 15:00 / 21:00 | 6h | `scripts/fetch_policy.py` | 抓取新华网/人民网/观察者网等 → `nav/data/policy.json` |
| **政策 AI 摘要** | 03:30 / 09:30 / 15:30 / 21:30 | 6h | `scripts/summarize_policy.py` | DeepSeek 精选政策解读 → `nav/data/policy_summary.json` |
| **研究 RSS 抓取** | 03:15 / 09:15 / 15:15 / 21:15 | 6h | `scripts/fetch_research.py` | 抓取 ArXiv AI/量化博客 → `nav/data/research.json` |
| **研究 AI 摘要** | 03:45 / 09:45 / 15:45 / 21:45 | 6h | `scripts/summarize_research.py` | DeepSeek 分类精选 → `nav/data/research_summary.json`3分类 |
| **市场行情** | 每整点 | 1h | `scripts/fetch_market.py` | A股指数 + 加密货币行情 → `nav/data/market.json` |
| **深度解读** | 22:35 | 每天 | `scripts/deep_dive.py` | 从要闻 Top1 提取 → DeepSeek 深度分析 800-1200 字 → `nav/data/deep_dive.json` |
| 每日简报生成 | 每4小时 | 4h | `scripts/daily_brief_gen.py` | 聚合交易日报 + 灵感分析 + 新闻摘要 → `nav/data/daily_brief.json` |
## 四、系统运维
| 任务 | 北京时间 | 频率 | 脚本 | 功能说明 |
|:---|:---:|:---|:---|:---|
| 全量灾备 | 12:00 | 每天 | `scripts/backup.sh`sudo | 备份系统配置/Docker/代码/数据库/证书 → `/home/ubuntu/backups/`保留7天 |
## 五、非 cron 自动化systemd 等)
| 服务 | 管理方式 | 说明 |
|:---|:---|:---|
| Caddy | systemd | 反向代理,自动 HTTPS |
| Freqtrade | Docker | 量化交易引擎,自动重启 |
| Memos | Docker | 灵感记录服务 |
| Vaultwarden | Docker | 密码管理器 |
| Gitea | systemd | Git 代码仓库 |
| Nav Dashboard | systemd | 个人导航页 |
---
## 数据流向图
```
Memos (灵感记录)
├─[22:30]─→ daily_digest.py ─→ DeepSeek API ─→ .md 文件 ─→ Git push
│ │
├─[每30min]─→ extract_todos.py ─→ todo API │
│ │
├─[每30min]─→ sync_cards.py ←→ Obsidian 文库 │
│ │
└─[周日16:00]─→ weekly_trend.py ─→ DeepSeek ─→ .md ─→ Git push
RSS 新闻 ─[每6h]──→ fetch_news.py ─→ news.json ────────────┐
RSS 政策 ─[每6h]──→ fetch_policy.py ─→ policy.json ────────┤
RSS 研究 ─[每6h]──→ fetch_research.py ─→ research.json ────┤
│ │
├─→ summarize_news.py ─→ news_summary.json ────┐
├─→ summarize_policy.py ─→ policy_summary.json ─┤
├─→ summarize_research.py ─→ research_summary ─┤
│ │
市场行情 ─[每h]──→ fetch_market.py ─→ market.json ────────┤
│ │
└──────────────────────────────→ brief.html
│ │
深度解读 ─[22:35]──→ deep_dive.py ←── news_summary.json ──┘ │
Freqtrade ─[07:55]─→ daily_brief.py ─→ .txt ──[08:05]─→ Git push │
│ │
Freqtrade ─[每h]──→ export_trades.sh ─→ Git push │
DeepSeek API ─[每h]─→ balance.py ─→ balance.json ──────────────────────→ Nav Dashboard
backup.sh [每天12:00]
```
---
## 更新记录
| 日期 | 版本 | 变更内容 |
|:---|:---:|:---|
| 2026-06-15 | v1.1 | 新增要闻扩展栏目政策速递、AI/量化前沿、市场行情、深度解读,共 6 个新脚本 + 6 条新 cron |