mirror of
https://github.com/eiblog/eiblog.git
synced 2026-03-01 00:34:58 +08:00
fix(backup): error path in compressed file
This commit is contained in:
@@ -44,7 +44,7 @@ func backupFromMongoDB(now time.Time) error {
|
|||||||
}
|
}
|
||||||
// tar
|
// tar
|
||||||
name := fmt.Sprintf("eiblog-%s.tar.gz", now.Format("2006-01-02"))
|
name := fmt.Sprintf("eiblog-%s.tar.gz", now.Format("2006-01-02"))
|
||||||
arg = fmt.Sprintf("tar czf /tmp/%s /tmp/eiblog", name)
|
arg = fmt.Sprintf("tar czf /tmp/%s -C /tmp eiblog", name)
|
||||||
cmd = exec.CommandContext(ctx, "sh", "-c", arg)
|
cmd = exec.CommandContext(ctx, "sh", "-c", arg)
|
||||||
err = cmd.Run()
|
err = cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user