mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 17:57:44 +08:00
24 lines
406 B
Go
24 lines
406 B
Go
//go:build darwin || freebsd || netbsd || dragonfly || openbsd
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"github.com/rclone/rclone/fs/accounting"
|
|
)
|
|
|
|
// 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())
|
|
}
|
|
}()
|
|
}
|