From c8fc9310c7078feeb2a621ed43a88299bd23cf3b Mon Sep 17 00:00:00 2001 From: Eric Renfro Date: Tue, 9 Jan 2024 22:50:29 -0500 Subject: [PATCH] Fix PWD issue for backups being in non-permissive directory. --- scripts/gitea | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/gitea b/scripts/gitea index 386b4e2..4c26521 100755 --- a/scripts/gitea +++ b/scripts/gitea @@ -62,7 +62,9 @@ runBackups() { backupDate=$(date +"%Y-%m-%d") giteaHome=$(getent passwd git | cut -f6 -d:) + pushd "${giteaDir}" &>/dev/null sudo -u "$GITEA_USER" "${GITEA_BIN}" dump --config "${GITEA_CONFIG}" --type tar.xz --file - > "${giteaDir}/gitea-dump-${backupDate}.tar.xz" + popd &>/dev/null } hook_before() {