Files
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.3 KiB
YAML

# docker-compose-backup example configuration
global:
backup_dir: /opt/docker-compose-backup/backups
# Staging area for the pre-compression copy. Defaults to the OS temp dir.
# Under the bundled systemd unit, set this inside the install dir so it stays
# within the sandbox's writable path (the unit no longer uses PrivateTmp).
temp_dir: /opt/docker-compose-backup/tmp
projects:
- name: myapp
path: /opt/docker/myapp
compose_file: docker-compose.yml # default
cron: "0 3 * * *" # daily at 3 AM, standard 5-field cron
exclude:
- ".git"
- "node_modules"
retention:
count: 7 # keep last 7 backups
# days: 30 # optional: also delete older than N days
- name: blog
path: /opt/docker/blog
cron: "0 */6 * * *" # every 6 hours
# Remote upload (optional) — uncomment and configure as needed.
# remote:
# s3:
# endpoint: https://s3.example.com
# bucket: my-backups
# access_key: ${S3_ACCESS_KEY}
# secret_key: ${S3_SECRET_KEY}
# region: us-east-1
# path_prefix: docker-backups/
#
# webdav:
# url: https://webdav.example.com/backups
# username: backup-user
# password: ${WEBDAV_PASSWORD}