Add backup_podman_volumes

This commit is contained in:
Jeffrey Serio 2025-01-23 00:42:28 -06:00
parent 0b5d67fe38
commit 4ea173845a

20
backup_podman_volumes Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
BACKUP_DIR="${HOME}/podman_volume_backups"
DATE=$(date '+%Y-%m-%d_%H%M%S')
volumes=(
"grafana-storage"
"semaphore_semaphore-mysql"
)
for vol in "${volumes[@]}"; do
podman volume export "$vol" --output "${BACKUP_DIR}/${vol}-${DATE}.tar"
gzip "${BACKUP_DIR}/${vol}-${DATE}.tar"
done
find "$BACKUP_DIR" -maxdepth 1 -mtime +7 -type f -delete
exit 0