Rclone ls and opy --max-size option doesn't work correctly with aws s3 bucket. When I use the option --max-size 2B it shows files that are much larger that 2 bytes
Run the command 'rclone version' and share the full output of the command.
rclone v1.69.1
os/version: ubuntu 24.04 (64 bit)
os/kernel: 6.8.0-55-generic (x86_64)
os/type: linux
os/arch: amd64
go/version: go1.24.0
go/linking: static
go/tags: none
Which cloud storage system are you using? (eg Google Drive)
aws s3
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone ls remote: --max-size 2B
The rclone config contents with secrets removed.
Results of the rclone config command:
Current remotes:
Name Type
==== ====
aws s3
A log from the command with the -vv flag
The size of the log is huge, but basically it looks like that
I can confirm the same issue on local drive, so it is not S3 specific:
$ rclone ls . --max-size 2B
276 kptsky.mouse-battery-check.log
1250 kptsky.wakeup.scheduler.log
I think you could open a bug report on github. It definitely does not work as it should.
It worked in v1.67.0 and is broken since v1.68.0 including the latest beta.
Maybe you could do git-bisect? Here a high level how to:
git checkout master
git bisect start
git bisect bad
git checkout v1.67.0
git bisect good
# now build rclone and test it
go build
./rclone ls . --max-size 2B
# if it worked
git bisect good
# if it failed
git bisect bad
# git will choose another commit
# go back to the go build step
# eventually git will stop and print the offending commit
# at the end
git bisect reset
This bug only affects --min-size and --max-size with a B suffix. It is proving a little tricky to fix but you can use a workaround --min-size 0.001k for --min-size 1B.
This could be documented and we could live without B. However this bug potentially affects existing scripts. Which is not good.
Also your workaround can be tricky for many people. Especially that for example 0.1K is 102B… not 100B.
I have not checked my scripts but I use B a lot. Regardless of size. I can display values in human readable format but to avoid accumulating errors during some more complex calculations B is the best choice to store values and use in rclone.
Not sure what your plan here is. IMO for completeness B suffix should be supported. In ideal world size value without suffix should represent B (not K as it is now) but it would be breaking change not bringing any specific value.
Short term it would be nice thing to have. Some mistakes could be avoided thx to it.
Most humans (excluding some geeks) always interpret value without specific unit as corresponding to the lowest unit available. So if we allow B it should be B.
Some Unix programs (rsync, df, du) for whatever historical reasons behave differently. But it is not really an argument for rclone to do the same.
Now I am thinking that bumping rclone version to 2.0 might be very good opportunity to get rid off many legacy things like B suffix one.
On the side note I would make sure that rclone 1.x should not "rclone selfupdate" to 2.0. Especially if there are breaking changes.