Files
docker-compose-backup/docker-compose-backup.service
T
m1saka 034edb2b1e fix: 修复备份工具的多处问题
- go.mod: 将非法版本号 go 1.26.4 改为 go 1.26
- engine: 压缩失败时删除残留的半截 tar.gz 文件
- config: 支持仅按天数保留(count 和 days 均未设时才用默认 count=7)
- engine: docker compose stop 失败时也尝试重启,避免容器停摆
- list: 仅显示真正的备份归档文件(新增导出 IsBackupArchive)
- systemd: 移除 PrivateTmp,暂存目录改到安装目录内,避免私有 /tmp 被大目录撑爆
2026-07-04 19:12:50 +08:00

38 lines
1.0 KiB
Desktop File

[Unit]
Description=Docker Compose Backup Daemon
After=network-online.target docker.service
Wants=network-online.target
Requires=docker.service
[Service]
Type=simple
WorkingDirectory=/opt/docker-compose-backup
ExecStart=/opt/docker-compose-backup/docker-compose-backup daemon -c /opt/docker-compose-backup/config.yaml
Restart=on-failure
RestartSec=30
TimeoutStopSec=60
KillMode=mixed
KillSignal=SIGTERM
# Security hardening
User=root
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
# The backup copies whole project directories into a staging area before
# compressing. Keep staging inside the writable install dir (see temp_dir in
# config.yaml) rather than /tmp, and do NOT use PrivateTmp — a private /tmp is
# often small/tmpfs-backed and can be exhausted by large project copies.
ReadWritePaths=/opt/docker-compose-backup
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictRealtime=yes
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=docker-compose-backup
[Install]
WantedBy=multi-user.target