initial pcp logging script
This commit is contained in:
parent
c34bf59852
commit
00e20ff1fe
1 changed files with 25 additions and 0 deletions
25
pcp.go
Normal file
25
pcp.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := exec.Command("sh", "-c", "pmdumptext -m -l -o -d , -c config")
|
||||
stdout, err := os.Create("./output.txt")
|
||||
cmd.Stdout = stdout
|
||||
fmt.Println("PCP started: ", stdout)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := cmd.Start(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := cmd.Wait(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
Reference in a new issue