Is it possible to use checksum only *if* timestamp differ?

I am sorry if this is yet another timestamp/size/checksum question that I should be able to understand by reading the docs, but I have read the relevant options and seem not to find anything, I would just like to make sure before I make a feature request,

I would like to use rclones standard comparison, that is only comparing time and size to determine if a file has changed. However, if time differs, I would like rclone to then checksum before uploading - and naturally don't upload the file if the checksum matches, but rather update the timestamp to match om the remote.

The reason for wanting this, is that I sometimes restores deleted files locally from a zfs snapshot in a way that messes with timestamps. In these cases I know I will have a substantial number of files that differ i timestamps, yet are the same. I would like to checksum these instead of just uploading due to my horrendous upload speeds at home. However, using the -c option would cause all files to be checksummed, which is overkill computation wise, as the majority of the file will have both matching sizes and timestamps, and doesn't need to be checksummed.

Just to make it clear, I would like to only checksum IF timestamp differ.

As I don't have problems with different commands not doing what I expect, but rather not finding a command to do what I want, a lot of the suggested info to copypaste here seems redundant,

But for good measure, here is the output of rclone version:

rclone v1.68.1-DEV
- os/version: freebsd 13.1-release-p9 (64 bit)
- os/kernel: 13.1-release-p9 (amd64)
- os/type: freebsd
- os/arch: amd64
- go/version: go1.21.13
- go/linking: dynamic
- go/tags: cmount

Not possible in one rclone command.

But you could do this with a bit of scripting kung-fu. Get list of files which differ (using timestamp/size only) and then feed into rclone copy (?) command (as filter from file maybe) where checksum is used.

For example:

rclone lsf src --format "pst" | sort > src-sorted
rclone lsf dst --format "pst" | sort > dst-sorted
comm -23 src-sorted dst-sorted > to-transfer

then extract paths only from to-transfer and use result as --filter-from in your rclone copy --checksum command

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