summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorChristoph Heiss <christoph@c8h4.io>2024-12-29 19:52:10 +0100
committerChristoph Heiss <christoph@c8h4.io>2024-12-29 19:59:22 +0100
commite8a022ac9aa4fc65a5405825c4e5124328030acc (patch)
treeb9830db9400198ce42a94bae4595defe67a11a50 /cmd
parentdump: reword cli flag descriptions and log messages (diff)
downloadforgejo-e8a022ac9aa4fc65a5405825c4e5124328030acc.tar.xz
forgejo-e8a022ac9aa4fc65a5405825c4e5124328030acc.zip
dump: add option to skip repository archives data
One might want to exclude this data when dumping, esp. since repository archives are more of temporary data by nature. Signed-off-by: Christoph Heiss <christoph@c8h4.io>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dump.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/dump.go b/cmd/dump.go
index 6bf1a1dc89..14f9a00b58 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -160,6 +160,10 @@ It can be used for backup and capture Forgejo server image to send to maintainer
Name: "skip-index",
Usage: "Skip bleve index data",
},
+ &cli.BoolFlag{
+ Name: "skip-repo-archives",
+ Usage: "Skip repository archives",
+ },
&cli.GenericFlag{
Name: "type",
Value: outputTypeEnum,
@@ -360,6 +364,11 @@ func runDump(ctx *cli.Context) error {
excludes = append(excludes, setting.Indexer.IssuePath)
}
+ if ctx.IsSet("skip-repo-archives") && ctx.Bool("skip-repo-archives") {
+ log.Info("Skipping repository archives data")
+ excludes = append(excludes, setting.RepoArchive.Storage.Path)
+ }
+
excludes = append(excludes, setting.RepoRootPath)
excludes = append(excludes, setting.LFS.Storage.Path)
excludes = append(excludes, setting.Attachment.Storage.Path)