From 1fffe2f4f8d45ba2b4e2a9d5bdd2df74c2bc1588 Mon Sep 17 00:00:00 2001 From: wanyaoqi Date: Mon, 22 Apr 2019 20:45:39 +0800 Subject: [PATCH] fix host clean recycle bin --- pkg/hostman/storageman/core.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/hostman/storageman/core.go b/pkg/hostman/storageman/core.go index adfc77311a..c8eb38797b 100644 --- a/pkg/hostman/storageman/core.go +++ b/pkg/hostman/storageman/core.go @@ -345,7 +345,9 @@ func cleanDailyFiles(storagePath, subDir string, keepDay int) { if date.Before(markTime) { log.Infof("Real delete %s", file) subDirPath := path.Join(recycleDir, file.Name()) - procutils.NewCommand("rm", "-rf", subDirPath) + if _, err := procutils.NewCommand("rm", "-rf", subDirPath).Run(); err != nil { + log.Errorf("clean recycle dir %s error %s", subDirPath, err) + } } } }