summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorglaszig <glaszig@gmail.com>2019-04-01 01:31:37 -0300
committertechknowlogick <matti@mdranta.net>2019-04-01 00:31:37 -0400
commitdbba46c2161c673b7818b6602ea2fb4efffe224e (patch)
treec11114797f72af49834bb4c5d35c782bb5195940 /cmd
parent2e1ead8054ae0dfbff44d6d7e0de56c72cbdfcf1 (diff)
downloadgitea-dbba46c2161c673b7818b6602ea2fb4efffe224e.tar.gz
gitea-dbba46c2161c673b7818b6602ea2fb4efffe224e.zip
support custom file name in `gitea dump` command (#6474)
* support custom file name in `gitea dump` command * simpler approach to handle default dump file name in `gitea dump` command
Diffstat (limited to 'cmd')
-rw-r--r--cmd/dump.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/dump.go b/cmd/dump.go
index a895785295..5d450822fb 100644
--- a/cmd/dump.go
+++ b/cmd/dump.go
@@ -35,6 +35,11 @@ It can be used for backup and capture Gitea server image to send to maintainer`,
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
+ cli.StringFlag{
+ Name: "file, f",
+ Value: fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix()),
+ Usage: "Name of the dump file which will be created.",
+ },
cli.BoolFlag{
Name: "verbose, v",
Usage: "Show process details",
@@ -85,7 +90,7 @@ func runDump(ctx *cli.Context) error {
dbDump := path.Join(tmpWorkDir, "gitea-db.sql")
- fileName := fmt.Sprintf("gitea-dump-%d.zip", time.Now().Unix())
+ fileName := ctx.String("file")
log.Printf("Packing dump files...")
z, err := zip.Create(fileName)
if err != nil {