30 lines
711 B
YAML
30 lines
711 B
YAML
|
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
|