-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
gitea dump does not respect --tempdir option #9100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not a Gitea dev, nor have I tested this, but I'd suggest trying
before running the dump, then run the dump with the Based on the code in this code from [https://github.com/go-gitea/gitea/blob/release/v1.8/cmd/dump.go#L81]:
there's presumably something in the dump process that relies on the TMPDIR environment variable. Gitea will set TMPDIR to the directory you provide via Could be worth a shot. |
Just a quick follow-up: I can confirm that both Gitea 1.9.1 and 1.9.5 respect the
and the dump contents are correctly staged in Note that the directory passed to Also, the If clearing your |
I have grown the partition so I can't see the disk full error anymore, but I have changed my dump script to this: export TMPDIR=/var/backups/gitea/
cd /var/backups/gitea/
sudo -u gitea gitea dump --tempdir /var/backups/gitea/ -c /etc/gitea/app.ini ran the script and watched files open by the
In the process environment I see $ sudo cat /proc/19206/environ
....TMP=/tmp/user/998TMPDIR=/tmp/user/998TEMP=/tmp/user/998TEMPDIR=/tmp/user/998 I don't know what sets TMPDIR to this path. Maybe it because it's run through |
That's a good thought. You'd probably have to enter a sudo shell as the 'gitea' user before setting TMPDIR and then running On the other hand, I guess I can't say with absolute certainty that no files are getting put into Of course, all of the rigmarole with the |
|
@nodiscc could you try a recent version, i.e. |
I will try ASAP |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
I no longer use the
Instead I simply backup the gitea data directory and database:
|
You can always use the |
This is good to know, it's not documented at https://docs.gitea.io/en-us/backup-and-restore/ though. Maybe raise another issue? However the dump command is not really satisfying for me:
For these reasons I am switching to the backup procedure I described above (dump the database, backup the db dump and gitea data directory). |
In addition, git |
This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. You can re-open it if needed. |
[x]
):Description
When specifying the
--tempdir
option forgitea dump
(https://docs.gitea.io/en-us/backup-and-restore/), the database dump seems to ignore the--tempdir
option and instead dumps to/tmp/
(or/tmp/$UID/
when usinglibpam-tmpdir
).In the case, where the
/tmp
partition is too small for the dump, the backup fails.I expect that it would dump repositories and the database to the directory specified with
--tempdir
.I am on 1.8.0 and attempting to backup before migrating/upgrading to 1.10.0 so if this is fixed in a later release, I'm also interested in any temporary/manual workaround/solution for 1.8.0. (In last resort I could grow the size of
/tmp
but it's not ideal)The text was updated successfully, but these errors were encountered: