diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index ddf84b4..ccd8926 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -93,14 +93,16 @@ func clientUploadFile(remote string, filePath string, uploadPath string) { // 调用外部组件scalib 程序执行 // ./scalib -h 192.168.66.92:9098 -f /www/gfs/sync_zips/BIU_20251009_153640.zip -u /www/afs/logs/ // 执行命令 - cmd := fmt.Sprintf("scalib -h %s -f %s -u %s", remote, filePath, uploadPath) - fmt.Printf("cmd: %s\n", cmd) + cmd := fmt.Sprintf("./scalib -h %s -f %s -u %s", remote, filePath, uploadPath) // 执行系统命令 - err := exec.Command(cmd).Run() + exec.Command(cmd) + out, err := exec.Command("sh", "-c", cmd).CombinedOutput() + if err != nil { logger.Error("ExecCommand failed", zap.Error(err)) fmt.Printf("ExecCommand failed: %v\n", err) return } + fmt.Printf("out: %s\n", out) }