Fix PWD issue for backups being in non-permissive directory.

This commit is contained in:
Eric Renfro 2024-01-09 22:50:29 -05:00
parent 57bac39365
commit c8fc9310c7
Signed by: psi-jack
SSH Key Fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM
1 changed files with 2 additions and 0 deletions

View File

@ -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() {