admin-scripts/shell/backup_podman_volumes
2025-03-23 06:58:14 -05:00

21 lines
406 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
BACKUP_DIR="${HOME}/podman_volume_backups"
DATE=$(date '+%Y-%m-%d_%H%M%S')
volumes=(
"shaarli_shaarli-cache"
"shaarli_shaarli-data"
)
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 +3 -type f -delete
exit 0