restic versionrestic 0.7.3
compiled with go1.9 on linux/arm
1, First, created backup for home dir:
$ cat .bash_aliases
export B2_ACCOUNT_ID="xy"
export B2_ACCOUNT_KEY="xy"
export RESTIC_REPOSITORY="b2:pi3-restic-home-backup"
export RESTIC_PASSWORD="xy"
2,
restic init
...
restic backup --one-file-system ~
done. It's worked.
Then I decided to make a full system backup so I created new bucket on B2, then:
$ sudo restic -r b2:rpi3-fullbackup backup --one-file-system --exclude /dev/ --exclude /lost+found/ --exclude /media/ --exclude /mnt/ --exclude /proc/ --exclude /sys/ --exclude /tmp/ --exclude /var/cache/apt/ /
Note the -r switch to override variable from .bash_aliases above.
Result:
unable to open repo at b2:rpi3-fullbackup: b2.NewClient: b2_authorize_account: 401: Invalid authorization token
B2
some B2 token?
Hey, thanks for the report. That's not a problem in restic, it's sudo which cleans the environment and removes the variables:
$ export FOO=bar
$ env | grep FOO
FOO=bar
$ sudo env | grep FOO
[sudo] password for fd0:
I see two solutions: Either configure sudo to pass on these environment variables (e.g. by using sudo -E) or write a shell script which sets the variables and then calls restic, and call the script via sudo.
I'm going to close this issue as it is not a problem in restic.
Most helpful comment
Hey, thanks for the report. That's not a problem in restic, it's
sudowhich cleans the environment and removes the variables:I see two solutions: Either configure sudo to pass on these environment variables (e.g. by using
sudo -E) or write a shell script which sets the variables and then calls restic, and call the script viasudo.I'm going to close this issue as it is not a problem in restic.