rclone/cmd/siginfo_bsd.go

25 lines
456 B
Go
Raw Normal View History

//go:build darwin || freebsd || netbsd || dragonfly || openbsd
// +build darwin freebsd netbsd dragonfly openbsd
2018-05-13 18:24:56 +00:00
package cmd
import (
"log"
"os"
"os/signal"
"syscall"
"github.com/rclone/rclone/fs/accounting"
2018-05-13 18:24:56 +00:00
)
// SigInfoHandler creates SigInfo handler
func SigInfoHandler() {
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINFO)
go func() {
for range signals {
log.Printf("%v\n", accounting.GlobalStats())
2018-05-13 18:24:56 +00:00
}
}()
}