I am wondering if it is possible to compare each file's hash in addition to (not instead of) its modtime, during a
Ideally, I am looking for one flag configuration that behaves in the following way:
When all three of
hashare available, compare all three, and if ANY of the three are not identical, replace the destination file with the source file.
When only 2 of the 3 are available (such as when syncing local to crypt backend which does not support hash), ignore the one that’s not available but still check the other two.
--checksum does not accomplish this because:
- When hash is available, it will not check modtime
- When hash is not available, it will fall back to
--size-only(and still not check modtime)
#2 is the greater concern for me, because instead of simply ignoring the
--checksum flag and using the default (modtime and size), it actually substitutes a different flag (
--size-only) which is less accurate than the default.
--refresh-times also does not accomplish this, because it has no effect when used with
--checksum, and on a crypt backend it would only update the timestamp, not the file contents.
Ideally I'm looking for one flag configuration that is agnostic to whether or not the source and dest have hashes in common, because I am scripting some sync tasks that reuse the same commands with different
dest:path variables, which will sometimes have a common hash and sometimes not. I could add some logic to check both remotes each time for a common hash and add
-c only if it finds one, but this would be a little more complicated and still wouldn't address issue #1 above.
--checksum across the board also does not do what I'm looking for, because then hashes would not be checked for files with matching size and modtime (even when hash is available.)
The command I normally use is:
rclone sync source:path dest:path --create-empty-src-dirs -MPc --drive-skip-gdocs -v
Is this possible? Grateful for any advice!