Restic: Restic still ask for password when is set to .bashrc

Created on 6 Mar 2020  ·  3Comments  ·  Source: restic/restic

Output of restic version

restic 0.9.6 compiled with go1.13.4 on linux/amd64

How did you run restic exactly?

restic -r backups/ snapshots

What backend/server/service did you use to store the repository?

I store the backups in local machine, in backups directory

Expected behavior
-----------------
restic -r backups/ snapshots
repository a59cec13 opened successfully, password is correct
ID        Time                 Host        Tags        Paths
-----------------------------------------------------------------------------------------------------
94b78cGh  2020-03-05 13:24:10  osw                     /var/www/standard
-----------------------------------------------------------------------------------------------------
1 snapshots

I want that restic reads the RESTIC_PASSWORD properly
I have set the RESTIC_PASSWORD in .bashrc file in order to let cron do backups automatly, but always ask for a password if I do not do RESTIC_PASSWORD=$RESTIC_PASSWORD

Actual behavior

Restic ask for a passwod

Steps to reproduce the behavior

Set restic password in .bashrc and then run source ~/.basrc and run restic -r /foo snapshots

Do you have any idea what may have caused this?

No

Do you have an idea how to solve the issue?

I have solved with this workaround export RESTIC_PASSWORD=$RESTIC && restic -r ....

Most helpful comment

@RafaelAybar You also need to export RESTIC_PASSWORD in your bashrc. Otherwise bash won't pass on the environment variable to restic.

All 3 comments

I've just tried it out and it's working for me. Maybe you have a typo in your .bashrc?

@RafaelAybar You also need to export RESTIC_PASSWORD in your bashrc. Otherwise bash won't pass on the environment variable to restic.

I've just tried it out and it's working for me. Maybe you have a typo in your .bashrc?

No, but i need to export RESTIC_PASSWORD=$RESTIC_PASSWORD when I log out and log in again

Was this page helpful?
0 / 5 - 0 ratings