feat(backup): back up k3s and Gitea to AIStor with alerts and drills #6
@@ -41,8 +41,15 @@ repos="$(grep -c -E '^repos/[^/]+/[^/]+\.git/HEAD$' "$work/list.txt" || true)"
|
||||
(( repos > 0 )) || hb_fail "the dump has no repositories"
|
||||
sha256sum "$work/$archive" | awk '{print $1}' >"$work/$archive.sha256"
|
||||
size="$(stat -c %s "$work/$archive")"
|
||||
# What a restore must match: restore with the same Gitea version (docs/runbooks/gitea-restore.md).
|
||||
{
|
||||
echo "created=$ts"
|
||||
echo "gitea_image=$(kubectl -n gitea get deploy gitea -o jsonpath='{.spec.template.spec.containers[0].image}')"
|
||||
echo "gitea_version=$(kubectl -n gitea exec deploy/gitea -c gitea -- gitea --version 2>/dev/null | awk '{print $3}')"
|
||||
echo "repositories=$repos"
|
||||
} >"$work/$archive.meta"
|
||||
|
||||
hb_mc "$work" cp --quiet "/work/$archive" "/work/$archive.sha256" "backup/$AISTOR_BUCKET/gitea/" >/dev/null
|
||||
hb_mc "$work" cp --quiet "/work/$archive" "/work/$archive.sha256" "/work/$archive.meta" "backup/$AISTOR_BUCKET/gitea/" >/dev/null
|
||||
hb_mc "$work" stat "backup/$AISTOR_BUCKET/gitea/$archive" >/dev/null
|
||||
|
||||
trap - ERR
|
||||
|
||||
Reference in New Issue
Block a user