Last active
March 18, 2026 12:08
-
-
Save seidler2547/c90667dcdb2b038f51eec3faac41024f to your computer and use it in GitHub Desktop.
CephFS CSI Kubernetes Backup to Proxmox Backup Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # this is just an example, better source this from a .env file or via cron/other means | |
| export PBS_PASSWORD=password | |
| export PBS_REPOSITORY=k8sbackup@pbs@pbs:backup | |
| ROOTNS=k8s | |
| cd /mnt/pve/cephfs/volumes/csi | |
| for d in csi-vol-* | |
| do | |
| cd $d | |
| NS="$(grep 'csi.storage.k8s.io/pvc/namespace = ' .meta | sed -e 's/^.* = //')" | |
| PVC="$(grep 'csi.storage.k8s.io/pvc/name = ' .meta | sed -e 's/^.* = //')" | |
| /usr/bin/proxmox-backup-client namespace create "${ROOTNS}/${NS}" | |
| /usr/bin/proxmox-backup-client backup "${PVC}.pxar:$PWD" --backup-id="${PVC}" --backup-type=ct --ns "${ROOTNS}/${NS}" | |
| cd - | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment