summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Van de Wauw <johan@gisky.be>2022-10-24 05:19:21 +0200
committerGitHub <noreply@github.com>2022-10-24 11:19:21 +0800
commit49874b7aadd717d174ded1cd54db88298a5b7afb (patch)
tree9478fd436d48678f123e75e19009e3e3b7282fa4
parentc04ad7632f92c70a8db2131cb6a3ce5fc6846505 (diff)
downloadgitea-49874b7aadd717d174ded1cd54db88298a5b7afb.tar.gz
gitea-49874b7aadd717d174ded1cd54db88298a5b7afb.zip
dump: Add option to skip index dirs (#21501)
closes #20683 Add an option to gitea dump to skip the bleve indexes, which can become quite large (in my case the same size as the repo's) and can be regenerated after restore. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r--cmd/dump.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/dump.go b/cmd/dump.go
index 73c2251b92..6569fb6e36 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -146,6 +146,10 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
Name: "skip-package-data",
Usage: "Skip package data",
},
+ cli.BoolFlag{
+ Name: "skip-index",
+ Usage: "Skip bleve index data",
+ },
cli.GenericFlag{
Name: "type",
Value: outputTypeEnum,
@@ -327,6 +331,11 @@ func runDump(ctx *cli.Context) error {
excludes = append(excludes, opts.ProviderConfig)
}
+ if ctx.IsSet("skip-index") && ctx.Bool("skip-index") {
+ excludes = append(excludes, setting.Indexer.RepoPath)
+ excludes = append(excludes, setting.Indexer.IssuePath)
+ }
+
excludes = append(excludes, setting.RepoRootPath)
excludes = append(excludes, setting.LFS.Path)
excludes = append(excludes, setting.Attachment.Path)