diff --git a/upgrade.sh b/upgrade.sh index 4663e1d..ab9cac4 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -40,7 +40,9 @@ function stop() { function backup() { set -ex - su - gitea -c "cd /srv/gitea/bin ; /srv/gitea/bin/gitea dump --tempdir /var/tmp/ -c /etc/gitea/gitea.ini" + now="$(date +%s)" + su - postgres -c "pg_dump -U postgres -O giteadb -Z 7" > "$BINDIR/gitea-${now}.sql.gzip" + su - gitea -c "cd $BINDIR; $BINDIR/gitea dump --tempdir /var/tmp/ -f gitea-dump-${now}.zip -c /etc/gitea/gitea.ini" set +x }