Files
docker-backup/llmdoc/architecture/systemd-integration.md
Wang Defa 4d00283654 feat: 实现 Docker 备份系统,支持远程一键安装
实现功能:
- 文件夹和 MySQL 容器数据库备份
- tar.gz 压缩和自动清理旧备份
- systemd 定时任务集成
- 远程一键安装脚本(通过 Gitea 仓库)
- 完整的 llmdoc 文档系统

安装方式:
bash <(curl -sL https://gitea.bcde.io/wangdefa/docker-backup/raw/branch/main/install.sh)

配置文件位置:/etc/docker-backup/config.yml
命令:docker-backup, docker-backup-cleanup
2025-12-25 15:02:07 +08:00

37 lines
1.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.
# Systemd 集成架构
## 1. 身份与目的
- **定义**Docker 备份项目的 Systemd 集成层
- **目的**:通过 Systemd 单元提供可配置、高效的自动备份机制
## 2. 核心组件
- `systemd/docker-backup.service.template`: Service 单元模板
- `systemd/docker-backup.timer.template`: Timer 单元模板
## 3. 执行流程LLM 检索路径)
### 定时触发
1. **Timer 激活**`docker-backup.timer` 根据配置的 `OnCalendar` 触发
2. **服务启动**:触发 `docker-backup.service`
3. **备份脚本执行**:运行 `bin/backup.sh`
### 依赖关系
```
docker-backup.timer
└── Requires: docker-backup.service
└── Requires: docker.service
```
## 4. 资源管理策略
- **CPU 管理**`Nice=19` - 最低优先级
- **IO 管理**`IOSchedulingClass=idle` - 仅在系统空闲时执行
- **超时控制**`TimeoutStartSec=1800` - 30分钟超时保护
## 5. 设计原理
- **模块化**:通过模板实现灵活配置
- **动态替换**:使用 `__INSTALL_DIR__``__SCHEDULE__` 变量
- **日志集成**:通过 systemd 日志系统journald收集日志