Skip to content

Commit

Permalink
opt(dbbackup):delete the *.err and *.pid files from tar package
Browse files Browse the repository at this point in the history
  • Loading branch information
ylgeeker committed Oct 22, 2024
1 parent 8c3b74f commit 63b164c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ func (p *PhysicalRocksdbLoader) load() error {
loaderCmd := fmt.Sprintf(`%s %s`, binPath, strings.Join(args, " "))
logger.Log.Infof("rocksdb physical loader command:%s", loaderCmd)

// delete *.pid, *.err files
errFiles := filepath.Join(p.targetName, "*.err")
pidFiles := filepath.Join(p.targetName, "*.pid")

logger.Log.Infof("delete the errors file:%s", errFiles)
cmutil.ExecCommand(true, "", "rm", errFiles)
logger.Log.Infof("delete the pid file:%s", pidFiles)
cmutil.ExecCommand(true, "", "rm", pidFiles)

// run command command
cmd := exec.Command("sh", "-c", loaderCmd)
outFile, err := os.Create(p.loaderLogfile)
if err != nil {
Expand Down

0 comments on commit 63b164c

Please sign in to comment.