2 minutes
Use Rclone For Encrypted Backups to Backblaze B2
Use Rclone For Encrypted Backups to Backblaze B2
To list remote buckets
rclone listremotes
encrypted-storage:
litmk:
rclone uses the remote to interface with the backblaze b2 bucket, then saves to folders within the bucket. Since litmk is the remote, let’s list the buckets and folders with lsd:
rclone lsd litmk:
-1 2022-08-21 00:31:42 -1 freebsd-heinlein
and now lsd for folders within the freebsd-heinlein bucket:
rclone lsd litmk:freebsd-heinlein
-1 2022-08-21 00:35:28 -1 backup
-1 2022-08-21 00:35:28 -1 test
Un-encrypted Backup
To copy a file without encryption to a folder named ’test’ in the ‘freebsd-heinlein’ bucket:
rclone copy cleartext-file.txt litmk:freebsd-heinlein/test/
rclone ls litmk:freebsd-heinlein
41481 test/cleartext-file.txt
Encrypted Backup
The remote “encrypted-storage” is set up to encrypt and save to “litmk:freebsd-heinlein/encrypted-backup/” so when we want to upload an encrypted backup we only need to specify the remote and then folder (leave the bucket “freebsd-eva” out): rclone copy secret-file.txt encrypted-storage:test rclone ls encrypted-storage: 41481 test/secret-file.txt
And that sits in the bucket as “freebsd-heinlein/encrypted-backup/192.SDRS/215.KxIx_MOLBGBzQ.HABKIFSB” because we have folder and file name obfuscation enabled.
For example:
rclone ls litmk:freebsd-heinlein/encrypted-backup
41529 192.SDRS/215.KxIx_MOLBGBzQ.HABKIFSB
The only way to see the decrypted files is to use the “encrypted-storage:” remote. If the unencrypted “litmk:” remote is used, rclone won’t decrypt the files.
To sync the /mnt/heinlein/pictures folder with encryption:
rclone sync /mnt/heinlein/pictures encrypted-storage:pictures
But best we do it with more simultaneous transfers to maximize throughput:
rclone --transfers 200 sync -v /mnt/heinlein/pictures encrypted-storage:pictures
The difference is 30-40 Mb/s to 800 - 950 Mb/s (peaked at 1.22 Gb/s. I have a 10 Gig internet connection at home :) ) Keep in mind this uses more RAM. When I checked it was using 7-8 Gigs.
270 Words
2024-11-13 00:00