2022-11-07 19:45:04 +08:00
|
|
|
//go:build darwin || freebsd || netbsd || dragonfly || openbsd
|
2018-05-14 02:24:56 +08:00
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"os/signal"
|
|
|
|
"syscall"
|
|
|
|
|
2024-08-18 22:58:35 +08:00
|
|
|
"github.com/rclone/rclone/fs"
|
2019-07-29 01:47:38 +08:00
|
|
|
"github.com/rclone/rclone/fs/accounting"
|
2018-05-14 02:24:56 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// SigInfoHandler creates SigInfo handler
|
|
|
|
func SigInfoHandler() {
|
|
|
|
signals := make(chan os.Signal, 1)
|
|
|
|
signal.Notify(signals, syscall.SIGINFO)
|
|
|
|
go func() {
|
|
|
|
for range signals {
|
2024-08-18 22:58:35 +08:00
|
|
|
fs.Printf(nil, "%v\n", accounting.GlobalStats())
|
2018-05-14 02:24:56 +08:00
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|