Add automatic database backup with download and restore docs.

Back up futures.db and uploads to /root/qihuo_backup on a daily schedule, expose backup downloads in settings, and document cross-server restore.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 13:04:48 +08:00
parent 508d85a282
commit 98239d29c1
7 changed files with 630 additions and 4 deletions
+5
View File
@@ -177,8 +177,11 @@
| 参考资金 | CTP 未连接时用于可开仓筛选与估算 |
| 企业微信 Webhook | 计划/关键位推送 |
| 修改密码 | 管理员密码 |
| 数据备份与恢复 | 自动/手动备份、下载压缩包、恢复说明 |
| 深色/浅色主题 | 页头切换 |
备份详情见 [BACKUP.md](./BACKUP.md)。
忘记密码:`python reset_admin.py`
---
@@ -231,6 +234,7 @@
| CTP 开盘前连接 | 默认开盘前 30 分钟 |
| 挂单超时撤单 | 可配置分钟数 |
| 止盈止损守护 | CTP 持仓监控线程 |
| 数据库自动备份 | 每日定时(默认 03:00)写入 `/root/qihuo_backup` |
---
@@ -244,6 +248,7 @@ qihuo/
├── ctp_trade_sync.py # 柜台成交同步到 trade_logs
├── product_recommend.py # 可开仓品种计算
├── stats_engine.py # 统计分析
├── db_backup.py # 数据库备份与恢复包
├── fee_specs.py / ctp_fee_sync.py
├── market.py / kline_chart.py
├── templates/ static/