How to restore a few files from millions on B2

What is the problem you are having with rclone?

I have 5 million file backed up to B2. I'd like to restore a dozen of them from a past version (before they were deleted). The process with using + **/name/** filter takes ages.

My filter is the following:

+ **/ota2azlubtml8rzv/**
+ **/5l3bcc0nt3fikrcs/**
+ **/w6ftdpeqf8ttio5m/**
+ **/eznv22kuwoj3ib9f/**
+ **/xrsnx1xs820ddjlt/**
+ **/0jvwq4qhnldibbrj/**
+ **/sprorcgni8wc8eo4/**
+ **/p1otvqn5k5yboxsw/**
+ **/3uzx17e2yn6dacim/**
+ **/jk8o7pxyzxxm2qpg/**
+ **/w70r7azdxhjcu931/**
+ **/pry4yr1oshvhvzco/**
+ **/lbv0nwaolwrrsydj/**
+ **/q11ovgacxawzcp4m/**
+ **/iaslf1sptxihqs9s/**
+ **/pcf6ec84vgka0vcm/**
+ **/garrannfnzhmtchm/**
- **

And here is the key: the files are in prefixed folders like
media/images/g/ar/garrannfnzhmtchm/1344_1008.jpg

I mean, with a normal file manager I can just go into g / ar / gar..., it's super quick. But I cannot get previous versions with a normal file manager.

I guess rclone is trying to list all 5 million files to find those selected. Extremely slow, and also I guess it's using a lot of B2 requests (costing money).

Is there any way to make it quick with rclone?

Run the command 'rclone version' and share the full output of the command.

rclone v1.69.2

  • os/version: darwin 15.4.1 (64 bit)
  • os/kernel: 24.4.0 (arm64)
  • os/type: darwin
  • os/arch: arm64 (ARMv8 compatible)
  • go/version: go1.24.2
  • go/linking: dynamic
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Backblaze B2

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone
copy
--config=/dev/null
--b2-account
b2_account
--b2-key
b2_key
--crypt-remote
f:b2:{b2_bucket_name}
--crypt-filename-encryption=off
--crypt-directory-name-encryption=false
--crypt-password
passkey
--transfers=32
--multi-thread-streams=32
--fast-list
--links
--local-no-check-updated
--log-file
x.log
-v
--stats=10s
--stats-file-name-length=0
--stats-one-line
--filter-from filter_file
--b2-version-at version_at

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

No config

A log from the command that you were trying to run with the -vv flag

No log, stopped after 30+ minutes

I would script this with the rc api.

There are any number of approaches to do this but a quick sketch of one is to use the rc api running on one process and then another making calls, preferable in parallel, to download the files. You'd probably want to devise a system for restarting or skipping but that depends on your use case.