It's a question: Does --size-only account for (rclone created) sparse-files?
If you sync from, say, S3 to local, rclone does sparse files for multi-part downloads. Depending on how sparse-files are stated, they may have their true size or their final size. If it is the final size, then sync --size-only will get false negatives for needing to sync
Run the command 'rclone version' and share the full output of the command.
In an attempt to answer my own question, I made a large (969932800 byte) file on a remote server and did a download to my local machine and cut it off.
Which means that rclone is also getting confused by itself.
Does this mean that a --size-only with a local may be tricked if it is still sparse but sparse to the full size? Imagine local to crypt(webdav) where size is all you can do! It is very possible.
The size used in --size-only is the size of the file as you might see in ls -l. This will always be the same regardless of whether the file contains sparse blocks or not.
When rclone is using multithread streaming it will download to different parts of the file at once, and this will make a sparse file on most OSes. The size as seen by ls -l will be the size of the final transfer, so if rclone is using 4 transfers it will be how far the 4th transfer has got, starting from 3/4 of the way through the file.
Yes.
In general --size-only is a pretty unreliable check and should only be used if you haven't got anything better. Rclone's default sync is size+modtime which is fast and reliable, or you can use --checksum which gives you size+hash which is slower but very accurate.
That is unfortunate as it is a very real possibility then to have unknown data loss.
It may not be worth the effort but one option would be to always write with one extra byte and then truncate when complete. That would make sure that it can't be fooled.
I get that but using something with crypt and webdav (or even just webdav) you don't have much of an option. Also, it's been my experience that nearly all file changes affect the size. Obviously it is trivial to create a counter-case but in general, realistic usage, this is what I'd expect. And an alarming number of remotes support neither hashes nor ModTime.