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

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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!