Hi.
The main issue for you, I think, is that you are running the gitea
command such that it is executing and trying to output the dump where the binary resides. This is usually /usr/local/bin
for a binary install (sorry, I’ve not used the snap install version, but the issue is the same).
Basically, what is happening when you do this, is that there are no write permissions for the output zip file in the directory where the binary resides.
My process for making it work is the following. I log in as the user that Gitea runs as (again, I’ve used the binary install, and as such I have the user git
. In the home directory of the git
user, I create a directory and then change into it:
mkdir dump
cd dump
Next I find out the path of the installed version of Gitea:
which gitea
# The output on my system is /usr/local/bin/gitea ; yours may differ!
and in the directory I just created, make a symbolic link to the Gitea binary.
ln -s /usr/local/bin/gitea ./gitea
You will now have a local executable in your writable dump directory. Now run the dump command, pointing at your particular configuration file for Gitea (on my server it is /etc/gitea/app.ini
:
./gitea dump -c /etc/gitea/app.ini
The ./
is important; it says to execute the instance of the gitea
binary which appears in the current directory. As the directory is writable, you should be able to complete your dump. Not sure why the sudo
version of the command would cause the enormous file (unless your repos are enormous).
Anyhow, I hope this helps. I have this directory set up on my server, with the symbolic link, and I can then run a cron
job every 12 hours to back up the Gitea instance.
Matthew