1
0

backup scripts

This commit is contained in:
michael 2024-02-10 23:12:35 +13:00
parent 39cb2b0007
commit bdf04302aa
3 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,9 @@
[Unit]
Description=K8s node backup timer
[Timer]
OnStartupSec=450s
OnUnitInactiveSec=86400s
[Install]
WantedBy=timers.target