diff --git a/cmd/restic/progress.go b/cmd/restic/progress.go index bb0bcd9fa..2fbd97c6c 100644 --- a/cmd/restic/progress.go +++ b/cmd/restic/progress.go @@ -14,12 +14,12 @@ import ( // for non-interactive terminals func calculateProgressInterval() time.Duration { interval := time.Second / 60 - fps, err := strconv.ParseInt(os.Getenv("RESTIC_PROGRESS_FPS"), 10, 64) - if err == nil && fps >= 1 { + fps, err := strconv.ParseFloat(os.Getenv("RESTIC_PROGRESS_FPS"), 64) + if err == nil && fps > 0 { if fps > 60 { fps = 60 } - interval = time.Second / time.Duration(fps) + interval = time.Duration(float64(time.Second) / fps) } else if !stdoutIsTerminal() { interval = 0 } diff --git a/doc/manual_rest.rst b/doc/manual_rest.rst index 3e567b359..d8167fb4a 100644 --- a/doc/manual_rest.rst +++ b/doc/manual_rest.rst @@ -138,7 +138,8 @@ Subcommands that support showing progress information such as ``backup``, ``--quiet`` is set. When running from a non-interactive console progress reporting is disabled by default to not fill your logs. For interactive and non-interactive consoles the environment variable ``RESTIC_PROGRESS_FPS`` -can be used to control the frequency of progress reporting. +can be used to control the frequency of progress reporting. Use for example +``0.016666`` to only update the progress once per minute. Additionally, on Unix systems if ``restic`` receives a SIGUSR1 signal the current progress will be written to the standard output so you can check up