cronjob-backup-minecraft.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. apiVersion: batch/v1
  2. kind: CronJob
  3. metadata:
  4. name: backup-minecraft-world
  5. spec:
  6. schedule: "30 2 * * *"
  7. concurrencyPolicy: Forbid
  8. jobTemplate:
  9. spec:
  10. template:
  11. spec:
  12. containers:
  13. - name: backup-minecraft-world
  14. image: registry.apps.openshift.local.pentou.ovh/penta/backup-job:1.0
  15. env:
  16. - name: BACKUP_DIR
  17. value: "/backups"
  18. - name: DIRECTORIES
  19. value: "/minecraft/Maisonnette /minecraft/Maisonnette_nether /minecraft/Maisonnette_the_end /minecraft/Survival /minecraft/Survival_nether"
  20. - name: RETENTION_DAYS
  21. value: "14"
  22. volumeMounts:
  23. - name: mc-data
  24. mountPath: "/minecraft"
  25. - name: mc-backup
  26. mountPath: "/backups"
  27. restartPolicy:
  28. OnFailure
  29. volumes:
  30. - name: mc-data
  31. persistentVolumeClaim:
  32. claimName: pvc-minecraft-server-data
  33. - name: mc-backup
  34. persistentVolumeClaim:
  35. claimName: pvc-minecraft-backup
  36. successfulJobsHistoryLimit: 3
  37. failedJobsHistoryLimit: 1