Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

Make it possible to disable stats printing with --stats=0

Nick Craig-Woode89ea3360eb6
diff --git a/rclone.go b/rclone.go
index 6f894db06..1ae464e43 100644
--- a/rclone.go
+++ b/rclone.go
@@ -28,7 +28,7 @@ import (
var (
// Flags
cpuprofile = pflag.StringP("cpuprofile", "", "", "Write cpu profile to file")
- statsInterval = pflag.DurationP("stats", "", time.Minute*1, "Interval to print stats")
+ statsInterval = pflag.DurationP("stats", "", time.Minute*1, "Interval to print stats (0 to disable)")
version = pflag.BoolP("version", "V", false, "Print the version number")
)
@@ -323,6 +323,9 @@ func NewFs(remote string) fs.Fs {
// Print the stats every statsInterval
func StartStats() {
+ if *statsInterval <= 0 {
+ return
+ }
go func() {
ch := time.Tick(*statsInterval)
for {