I’ve been using Restic to B2 for a couple years now and it’s worked great, however, I’m changing my backup strategy and I’ve hit some snags.
My new backup flow includes two backups to an external HDD: 1) a restic script backing up my user data 2) a Timeshift schedule backing up files owned by BOTH root and a user named “bob”. The second stage of my backup flow is to then use Restic to backup the entire HDD to Backblaze.
The immediate issue I have is I can’t seem to run the Backblaze backup command without error because when I attempt to run the backup as root, it doesn’t see the environment variables required. I can set the environment variables at user bob’s level but apparently not as root. I’m assuming since I’m now trying to backup the Timeshift data described above that I must backup as root to have the priveleges required to both backup and restore properly but correct me if I’m wrong.
Here’s a screen capture:
root@pop-os:/media/bob/RED_BACKUP# export B2_ACCOUNT_ID=xxx
root@pop-os:/media/bob/RED_BACKUP# sudo restic -r b2:bucketname:foldername --verbose backup /media/bob/RED_BACKUP
Fatal: unable to open B2 backend: Account ID ($B2_ACCOUNT_ID) is empty
Any guidance in how to achieve my goal is greatly appreciated!