From fc7707aff2ac1b721f21ede0a8e0609db3db0fa0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 25 May 2022 23:27:33 +0200 Subject: [PATCH] Add a sample backup cronjob --- generic/rsync-backup-cronjob.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 generic/rsync-backup-cronjob.yaml diff --git a/generic/rsync-backup-cronjob.yaml b/generic/rsync-backup-cronjob.yaml new file mode 100644 index 0000000..f037c62 --- /dev/null +++ b/generic/rsync-backup-cronjob.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: + backup-test +spec: + schedule: "* * * * *" + jobTemplate: + spec: + template: + spec: + containers: + - name: backup + image: instrumentisto/rsync-ssh:alpine3.16 + args: + - sh + - -c + - "rsync -a /etc/ /mnt/etc-dir/$(date +%a%H%M)" + volumeMounts: + - mountPath: /mnt + name: backup + restartPolicy: Never + nodeSelector: + kubernetes.io/hostname: "server101" + volumes: + - name: backup + hostPath: + path: /mnt + type: Directory