Patch: Add --summary and --summary-file options
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 59.8k
- Forks
- 5.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 48
Description
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
patchutility 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading cmd/cmd.go and fs/config.go, which the proposed patch changes, then inspect the existing transfer statistics flow and configuration options. Confirm that --summary displays the final summary and --summary-file appends it to the specified file, including when both options are used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100