[SOLVED] Backup client asking for PBS user password even though it's in the PBS_PASSWORD environment variable.

EllyMae

Member
Jul 20, 2022
133
10
23
Why is that happening?

I proceed the backup command with export PBS_PASSWORD=<redacted> but it still asks for the password.
 
Last edited:
Did you tried a export PBS_PASSWORD='<redacted>'?
Well, I did echo $PBS_PASSWORD, and it gave me the correct answer.

Here is the script:
Code:
export PBS_PASSWORD=<redacted>
export PROXMOX_OUTPUT_NO_BORDER=1
sudo proxmox-backup-client backup \
        root.pxar:/  \
        home.pxar:/home \
        --repository dan1@pbs@192.168.1.50:usb-8tb \
        --ns rocky
 
Last edited:
Well, I did echo $PBS_PASSWORD, and it gave me the correct answer.

Here is the script:
Code:
export PBS_PASSWORD=<redacted>
export PROXMOX_OUTPUT_NO_BORDER=1
sudo proxmox-backup-client backup \
        root.pxar:/  \
        home.pxar:/home \
        --repository dan1@pbs@192.168.1.50:usb-8tb \
        --ns rocky
This just popped into my head: By using sudo, did I change the context so that the exported variables are no longer visible?

...

So, I took the sudo out of the script and executed the script with sudo (sudo ./pbsbackup). It worked perfectly.
 
Last edited:
yes, sudo cleans up the environment (you can control that via --preserve-env, see man sudo)
 
  • Like
Reactions: EllyMae