Hi all
I’m running restic 0.9.6 on my local Ubuntu 20.04. All credentials are properly stored in /etc/environment
as follows:
B2_ACCOUNT_ID=1234
B2_ACCOUNT_KEY=1234
RESTIC_REPOSITORY=b2:test-backup:folder1
RESTIC_PASSWORD=1234
This works flawlessly. However, if I try to run a backup with root
instead of my own user, It cannot access the B2 bucket for some reason. For example executing sudo restic snapshots
results in:
Fatal: unable to open config file: Stat: b2_download_file_by_name: 404: File with such name does not exist.
Is there a repository at the following location?
b2:test-backup:folder1
If I execute the same without sudo
, it shows all my snapshots. First I thought that root
user has no access to the variables defined in /etc/environment
. However, If I execute echo $B2_ACCOUNT_ID
with user root
, it correctly shows the content, so the variables are available.
I’m lost. Do you have any ideas! Any help appreciated
Kind regards,
Tom