Skip to content

Commit

Permalink
refine export cleaner (#2916)
Browse files Browse the repository at this point in the history
* refine export cleaner
  • Loading branch information
lichunzhu committed Jul 14, 2020
1 parent 02bc61b commit e2fcef5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/backup-manager/app/clean/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ func (bo *Options) cleanRemoteBackupData(bucket string, opts []string) error {
args := util.ConstructArgs(constants.RcloneConfigArg, opts, "deletefile", destBucket, "")
output, err := exec.Command("rclone", args...).CombinedOutput()
if err != nil {
if exitError, ok := err.(*exec.ExitError); ok {
if code := exitError.ExitCode(); code == 3 || code == 4 {
klog.Infof("cluster %s backup %s has already been deleted before", bo, bucket)
return nil
}
}
return fmt.Errorf("cluster %s, execute rclone deletefile command failed, output: %s, err: %v", bo, string(output), err)
}

Expand Down

0 comments on commit e2fcef5

Please sign in to comment.