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