Files
Deploy-Laboratory/ansible/files/openlist/openlist-backup-cronjob.yaml
jack be97836e0d chore: 清理调试脚本并收敛到 Ansible 流程
移除已废弃的调试/验证脚本与空目录,统一文档与脚本说明到 ansible-playbook 的部署方式,避免失效引用和误用路径。

Made-with: Cursor
2026-03-23 19:18:55 +08:00

28 lines
1.4 KiB
YAML
Raw 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.
# docs/05-06-openlist挂载网盘与自动备份.md — 替换镜像与 PVC 名
apiVersion: batch/v1 # CronJob 所属 APIbatch/v1
kind: CronJob # 定时任务CronJob
metadata: # 资源元信息
name: openlist-backup # CronJob 名称
namespace: default # CronJob 所在命名空间
spec: # CronJob 期望状态
schedule: "0 3 * * *" # 任务调度:每天 03:00cron 格式)
jobTemplate: # 每次触发生成的 Job 模板
spec: # Job spec
template: # Job Pod 模板
spec: # Pod spec
containers: # 容器列表
- name: openlist-backup # 容器名
image: your-registry/openlist-backup:latest # 镜像(需替换为你的镜像)
args: # 容器启动命令参数
- /bin/sh # 使用 shell
- -c # shell 执行模式
- /backup.sh # 运行脚本
volumeMounts: # 挂载卷
- name: backup-target # 引用 volumes[].name
mountPath: /backup # 容器内挂载目录
volumes: # 卷列表
- name: backup-target # 卷名(与 volumeMounts 对齐)
persistentVolumeClaim: # 使用 PVC 作为存储来源
claimName: openlist-backup-pvc # 绑定的 PVC 名称(需保证存在)
restartPolicy: OnFailure # Pod 失败后重启策略:仅失败时重启