Feature request to sort change log files after transferring commands' execution

Hello there.

After using rclone for synchronization between a local source system and a remote destination cloud storage, I've realized that log files storing changes of such commands which transfer data (sync, copy, copyto , move, moveto) are filled in random order by default (i.e. not alphabetically), because that's the nature of checking and transferring source files to destination in the first place within the rclone backend logic.

I guess the only option to run through the source files alphabetically (and then to sync those files to destination and to write those changes to logs alphabetically as well) is to use the --order-by=name parameter (only for sync, copy and move commands). But it does not guarantee a perfect ordering anyway, maybe even in combination with the --check-first parameter.

If you'd like to sort such transferring change log files afterwards, it should be done in two different ways:

  1. The one combined log file should not be sorted regularly, but from the third character to the end of each line within, because the first character of each line there is a status icon (= - + * !), and the second character is the space between a status icon and a file path.
  2. All of the other change log files (match differ missing-on-src missing-on-dst error) should be sorted regularly, i.e. by each line within the file completely.

Here is the block of code that provides such an in-place sorting on a Linux machine:

	sort -k1.3 "${log_file_mask}_combined.log" -o "${log_file_mask}_combined.log"

	for suffix in match differ missing-on-src missing-on-dst error; do
		log_file_name="${log_file_mask}_${suffix}.log"

		if [ -f "$log_file_name" ]; then
			sort "$log_file_name" -o "$log_file_name"
		fi
	done

So I’d like to know if that would make sense to add a separate parameter to these rclone transferring commands (sync, copy, copyto , move, moveto) that might be called, for example, --sort-transfer-logs, to properly sort such log files alphabetically at the end of transferring command’s execution.

Of course, it may not be approved as a proposed feature request, because somehow it goes beyond the rclone application main scope of tasks. In such a way I'd like to add such sorting considerations to the Logging section of Usage documentation page.

welcome to the forum,

seems very niche, but rclone is open-source, you can write the source code yourself or sponsor

there are many things i wish rclone did, like create microsoft VSS snapshots, so i shared a script in a howto guide and wiki
How to enable VSS for rclone on Windows
or create s3 temporary session tokens, so i wrote a python script for that.


the docs are open source, anybody can edit them.
tho, inserting that linux only script into the docs is not good idea for a bunch of reasons.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.