backup scripts
This commit is contained in:
parent
39cb2b0007
commit
bdf04302aa
@ -17,3 +17,7 @@ tar -czf /backup/ceph/ceph_$TIMESTAMP.tar.gz /var/lib/rook
|
|||||||
# Replicate backup to hv00
|
# Replicate backup to hv00
|
||||||
rsync -az /backup/etcd/snapshot_$TIMESTAMP.db backup:/mnt/backup/etcd/snapshot_$TIMESTAMP.db
|
rsync -az /backup/etcd/snapshot_$TIMESTAMP.db backup:/mnt/backup/etcd/snapshot_$TIMESTAMP.db
|
||||||
rsync -az /backup/ceph/ceph_$TIMESTAMP.tar.gz backup:/mnt/backup/ceph/ceph_$TIMESTAMP.tar.gz
|
rsync -az /backup/ceph/ceph_$TIMESTAMP.tar.gz backup:/mnt/backup/ceph/ceph_$TIMESTAMP.tar.gz
|
||||||
|
|
||||||
|
# Cleanup backups older than 7 days
|
||||||
|
find /backup/etcd -type f -mtime +7 -delete
|
||||||
|
find /backup/ceph -type f -mtime +7 -delete
|
||||||
|
@ -1,2 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Backup K8s node etcd and ceph data
|
||||||
|
|
||||||
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/scripts/node-backup.sh
|
ExecStart=/bin/bash /scripts/node-backup.sh
|
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=K8s node backup timer
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnStartupSec=450s
|
||||||
|
OnUnitInactiveSec=86400s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
Loading…
Reference in New Issue
Block a user