From 61b85990a62419aed0d425643cf723866e6de760 Mon Sep 17 00:00:00 2001 From: Alexandros Nicolaides <10987574+anicolaides@users.noreply.github.com> Date: Mon, 8 Apr 2019 15:45:29 +0300 Subject: [PATCH] Added docker example for backup (#5846) * Added docker example for backup * Fix using docker command example * Clarify --tempdir as per @lafriks suggestion --- docs/content/doc/usage/backup-and-restore.en-us.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/content/doc/usage/backup-and-restore.en-us.md b/docs/content/doc/usage/backup-and-restore.en-us.md index 9c24cb3d2f..0552d2b212 100644 --- a/docs/content/doc/usage/backup-and-restore.en-us.md +++ b/docs/content/doc/usage/backup-and-restore.en-us.md @@ -44,6 +44,19 @@ Inside the `gitea-dump-1482906742.zip` file, will be the following: Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable. +### Using Docker (`dump`) +There are a few caveats for using the `dump` command with Docker. + +The command has to be executed with the `RUN_USER = ` specified in `gitea/conf/app.ini`; and, for the zipping of the backup folder to occur without permission error the command `docker exec` must be executed inside of the `--tempdir`. + +Example: + +```docker exec -u -it -w <--tempdir> $(docker ps -qf "name=") bash -c '/app/gitea/gitea dump -c '``` + +*Note: `--tempdir` refers to the temporary directory of the docker enviroment used by gitea; if you have not specified a custom `--tempdir`, then gitea uses `/tmp` or the `TMPDIR` enviromental variable of the docker container. For `--tempdir` adjust your `docker exec` command options accordingly. + +The result should be a file, stored in the `--tempdir` specified, along the lines of: `gitea-dump-1482906742.zip` + ## Restore Command (`restore`) There is currently no support for a recovery command. It is a manual process that mostly