2022-11-07 11:45:04 +00:00
|
|
|
//go:build darwin || freebsd || netbsd || dragonfly || openbsd
|
2018-05-13 18:24:56 +00:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
"os/signal"
|
|
|
|
"syscall"
|
|
|
|
|
2019-07-28 17:47:38 +00:00
|
|
|
"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 {
|
2019-07-28 19:38:20 +00:00
|
|
|
log.Printf("%v\n", accounting.GlobalStats())
|
2018-05-13 18:24:56 +00:00
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|