Rcat with --checksum never matches


#1

I think I may have found a bug:

I’m trying to do a tar copy to M$ Onedrive (for businesses). The following works nicely (no copy when there are no changed files):

tar cf - $DIRPATH --mtime='1970-01-01' | xz > temp_file.tar.xz
rclone --checksum sync temp_file.tar.xz onedrive:backup/

While this always makes a copy (example inspired by https://rclone.org/commands/rclone_rcat/):

tar cf - $DIRPATH --mtime='1970-01-01' | xz | rclone --checksum rcat onedrive:backup/temp_file.tar.xz

If I download the rcat’ed files they are identical. Is this expected behavior or is it a bug? I think these two commands should work the same in this case.

I’m using rclone 1.41 on Ubuntu 16.04 (go 1.10).


#2

It is expected behaviour…

rcat will stream the file to the upload so it doesn’t know how big the file is or its checksum when it starts the upload so it will upload it regardless :frowning:


#3

That makes perfect sense! Maybe the example in the documentation should be updated to reflect this? I guess --checksum is not meaningful for rcat.


#4

Updating the example is a good idea! I’ll do that now…

Hmm --checksum could work if the file is greater than

  --streaming-upload-cutoff int         Cutoff for switching to chunked upload if file size is unknown. Upload starts after reaching cutoff or when file ends. (default 100k)

I’m not sure it actually does though - what do you find?