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