Skip to content

Patch: Add --summary and --summary-file optionsΒ #9068

@CarlEdZa

Description

@CarlEdZa

Rclone Summary Patch

This patch adds two new options to rclone:

  • --summary : Show a summary at the end of the transfer
  • --summary-file <path> : Append the summary to the specified file
  • You may use both options together to output to the screen and save to file

Usage

Apply this patch to the rclone source tree if you want these options.
It is provided as-is. No binaries, forks, or support are offered.

Notes

  • Requires the patch utility to apply.
  • Works against the rclone source version from December 2025.
  • If your source tree differs, hunks may fail and require manual merging.

Copy and paste the below to a patch file.

diff -ruN rclone-original/cmd/cmd.go rclone-modified/cmd/cmd.go
--- rclone-original/cmd/cmd.go	2025-12-22 23:39:53 +0000
+++ rclone-modified/cmd/cmd.go	2025-12-29 19:21:56 +0000
@@ -292,9 +292,22 @@
 		}
 	}
 	stopStats()
-	if showStats && (accounting.GlobalStats().Errored() || *statsInterval > 0) {
+	if (showStats || ci.Summary) && (accounting.GlobalStats().Errored() || *statsInterval > 0 || ci.Summary) {
 		accounting.GlobalStats().Log()
 	}
+	if ci.SummaryFile != "" {
+		message := fmt.Sprintf("%s NOTICE: \n%v", time.Now().Format("2006/01/02 15:04:05"), accounting.GlobalStats().String())
+		f, err := os.OpenFile(ci.SummaryFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
+		if err != nil {
+			fs.Errorf(nil, "Failed to open summary file: %v", err)
+		} else {
+			_, err = f.Write([]byte(message))
+			if err != nil {
+				fs.Errorf(nil, "Failed to write to summary file: %v", err)
+			}
+			_ = f.Close()
+		}
+	}
 	fs.Debugf(nil, "%d go routines active\n", runtime.NumGoroutine())
 
 	if ci.Progress && ci.ProgressTerminalTitle {
diff -ruN rclone-original/fs/config.go rclone-modified/fs/config.go
--- rclone-original/fs/config.go	2025-12-22 23:39:53 +0000
+++ rclone-modified/fs/config.go	2025-12-29 19:21:39 +0000
@@ -404,6 +404,16 @@
 	Help:     "Show progress during transfer",
 	Groups:   "Logging",
 }, {
+	Name:    "summary",
+	Default: false,
+	Help:    "Show a summary at the end of the transfer",
+	Groups:  "Logging",
+}, {
+	Name:    "summary_file",
+	Default: "",
+	Help:    "Append a summary at the end of the transfer to this file",
+	Groups:  "Logging",
+}, {
 	Name:    "progress_terminal_title",
 	Default: false,
 	Help:    "Show progress on the terminal title (requires -P/--progress)",
@@ -643,6 +653,8 @@
 	StatsOneLineDateFormat     string            `config:"stats_one_line_date_format"` // If we want to customize the prefix
 	ErrorOnNoTransfer          bool              `config:"error_on_no_transfer"`       // Set appropriate exit code if no files transferred
 	Progress                   bool              `config:"progress"`
+	Summary                    bool              `config:"summary"`
+	SummaryFile                string            `config:"summary_file"`
 	ProgressTerminalTitle      bool              `config:"progress_terminal_title"`
 	Cookie                     bool              `config:"use_cookies"`
 	UseMmap                    bool              `config:"use_mmap"`
@@ -705,8 +717,8 @@
 		ci.LogLevel = LogLevelDebug
 	}
 
-	// If --dry-run or -i then use NOTICE as minimum log level
-	if (ci.DryRun || ci.Interactive) && ci.StatsLogLevel > LogLevelNotice {
+	// If --dry-run, -i or --summary then use NOTICE as minimum log level
+	if (ci.DryRun || ci.Interactive || ci.Summary) && ci.StatsLogLevel > LogLevelNotice {
 		ci.StatsLogLevel = LogLevelNotice
 	}
 

How to use GitHub

  • Please use the πŸ‘ reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions