`rclone check` find which file is newer if there is a difference

Thanks for providing the great rclone check tool, it works very nicely.

As far as I can tell from the documentation, if two files differ across source and target, it is not possible to find which one is newer. Is this the case?

If this is the case, it would be nice to have additional output e.g. in --combine, a ">" and "<" that indicate if, there is a difference, the source is newer than target of vice versa.

Did you test it out?

rclone check /Users/etexter/Downloads/1 /Users/etexter/Downloads/2
2023/11/14 07:11:44 ERROR : test.pdf: sizes differ
2023/11/14 07:11:44 NOTICE: Local file system at /Users/etexter/Downloads/2: 1 differences found
2023/11/14 07:11:44 NOTICE: Local file system at /Users/etexter/Downloads/2: 1 errors while checking
2023/11/14 07:11:44 Failed to check: 1 differences found

Thanks for your help! I did test this with the --combine flag. I cannot see in the log you posted the indication of which version is bigger (in this case, though I am more interested in which version is newer). It just says that test.pdf has different sizes between source and target. Am I missing something?

I believe that would be the point of check as you are comparing the source to the destination and it's indicating they are different so if it was me, I would most likely recopy the source to destination as I'm assuming the source is the source of truth.

It really depends on what your logic/use case is.

What's newer? Size? Modtime?

Thanks @Animosity022! In our use case, it is not always clear whether source vs. destination is newer because we can have source machines copying to a single destination machine.

This is a good point and the complexity quickly grows, it is not as simple as XXX file is 'newer'. Nonetheless I think it would be a useful feature for the output of check to contain information on in which direction any difference that is found goes.

For example, if
2023/11/14 07:11:44 ERROR : test.pdf: sizes differ
could become
2023/11/14 07:11:44 ERROR : test.pdf: sizes differ, source is large

or if modtime differs, source is newer. Of course, I am saying this entirely from a user perspective and have no idea on any implementation difficulties or alternative complex cases I have not considered.

In case this is helpful: you can get some of what you're looking for by running a --dry-run of rclone sync with -vv, instead of rclone check. For example:

rclone sync 'Folder A' 'Folder B' -vv --dry-run

will show you things like:

2023/11/16 05:39:33 DEBUG : File1.zip: Sizes differ (src 42690 vs dst 84354)
2023/11/16 05:39:33 DEBUG : SizeSameTimeDifferent.zip: Modification times differ by -46h8m39.162801927s: 2023-11-16 05:39:18.019157 -0500 EST, 2023-11-14 07:30:38.856355073 -0500 EST

Whereas rclone check 'Folder A' 'Folder B' -vv would only show you:

2023/11/16 05:43:20 ERROR : File1.zip: sizes differ
2023/11/16 05:43:20 DEBUG : SizeSameTimeDifferent.zip: md5 = eb851f12cd4495a82b82bc1eb953328a OK

(I agree it would be nice if check showed more of this debug info too.)