Add backup_podman_volumes
This commit is contained in:
parent
0b5d67fe38
commit
4ea173845a
20
backup_podman_volumes
Executable file
20
backup_podman_volumes
Executable 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
|
Loading…
x
Reference in New Issue
Block a user