rustic-rs / docs

rustic user documentation
http://rustic.cli.rs/docs/
Mozilla Public License 2.0
9 stars 12 forks source link

docs: how to backup to B2 #5

Open dsully opened 1 year ago

dsully commented 1 year ago

Hi - I'm currently using restic and wanted to try rustic as an alternative. However, I'm having trouble backing up directly to B2.

Here's the repository section of rustic.toml:

[repository]
repository = "rclone:b2:remote"
password-file = "..."

And my rclone.conf:

[remote]
type = b2
account = ...
key = ...
hard_delete = true

If I run rustic backup:

$ rustic backup
using config /root/.config/rustic/rustic.toml
[INFO] rclone output: 2023/04/28 16:54:26 Failed to create file system for "b2:remote": didn't find section in config file

Error: rclone exited with exit status: 1

I've tried various permutations of the repository name, with a : appended or removing b2:

$ rustic backup
using config /root/.config/rustic/rustic.toml
Error: No repository config file found. Is there a repo at rclone:remote:?

My existing restic config can backup directly to B2 without needing rclone at all.

The example here with OVH: https://github.com/rustic-rs/rustic/blob/main/examples/ovh-hot-cold.toml indicates I can do a direct backup to a remote provider.

Thanks

aawsome commented 1 year ago

Judging from your rclone config, the repository should look like rclone:remote:. You can always try if rclone is able to access the storage and then prefix the access path with rclone:.

dsully commented 1 year ago

For a future reader, this is what worked for me finally:

$XDG_CONFIG_HOME/rustic/rustic.toml:

[repository]
repository = "rclone:remote:<my-bucket-name>"

$XDG_CONFIG_HOME/rclone/rclone.conf:

[remote]
type = "b2"
account = "<account-id>"
key = "<account-key>"
hard_delete = true

If/until there is a native B2 backend for Rustic.

@aawsome Not sure if this should go into a user guide, or the Wiki (which looks to be disabled).