summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-10 09:10:16 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-10 09:10:16 -0800
commitb1ebce16d057b73027b864de52a652c77ee76b46 (patch)
tree182d07459dfc22ca489ff302d1deb929b386afb1
parent739f7227a94a909feddc2f4bfe7eb642df6152dd (diff)
downloadstandingwithresilience-b1ebce16d057b73027b864de52a652c77ee76b46.tar.gz
standingwithresilience-b1ebce16d057b73027b864de52a652c77ee76b46.zip
small dog organization
-rwxr-xr-xgit-maintenance/dog.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/git-maintenance/dog.sh b/git-maintenance/dog.sh
index 757fcc4..7c806b0 100755
--- a/git-maintenance/dog.sh
+++ b/git-maintenance/dog.sh
@@ -31,6 +31,10 @@ echo ""
echo "This script is expected to be kept in sync with:"
echo " ${URLPFX}/dog.sh"
echo ""
+echo "Repository will be broken until download completes, as a quick way to ensure data"
+echo "is still all accessible by redownloading all of it."
+echo "Backup is in .git/bak, must be restored manually."
+echo ""
# 2. mkdir -p .git/encrypted and git init
mkdir -p "$REPONAME"
@@ -39,12 +43,13 @@ if ! [ -d ".git" ]; then git init; fi
git config gc.auto 0
+chown -R "$USER":"$USER" .git
pushd .git
# prevent recreation of existing data
mkdir -p encrypted
mkdir -p bak
-cp -va HEAD refs objects/pack bak
-rm objects/pack/*
+cp --force -a HEAD refs objects/pack bak
+rm --force objects/pack/*
# 3. download .git/encrypted with wget
curl -sfI "$URLPFX"/refs.aes?"$NONCE">/dev/null && wget "$URLPFX"/refs.aes?"$NONCE" -O encrypted/refs.aes || echo "==== BROKEN REMOTE refs.aes PLEASE RE-STORE OR RECOVER ===="
@@ -61,6 +66,8 @@ do
openssl aes-256-cbc -salt -pbkdf2 -pass "$PASS" -d -in encrypted/"$encpack" | tar -Jxvf -
done
+chown -R "$USER:$USER" .
+
for pack in objects/pack/*.pack
do
git index-pack "$pack"