diff --git a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_physical_rocksdb.go b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_physical_rocksdb.go index bc20aff819..21377d6035 100644 --- a/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_physical_rocksdb.go +++ b/dbm-services/mysql/db-tools/mysql-dbbackup/pkg/src/backupexe/loader_physical_rocksdb.go @@ -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 {