proxmox-backup-client login?

Offf256

Active Member
Feb 18, 2014
17
5
43
I have enormous data part that I can not backup at once. I tried to manually split it to chunks w. simple script

proxmox-backup-client login --repository ... for file in $(ls -1d sompath) do proxmox-backup-client backup ...$file. pxar:...$file --repository ... done

PROBLEM: proxmox-backup-client --login does not work as intended. It asks me to log on (again) before every job (every iteration of for) . What I am doing wrong?
 
So, after some investigation, I've come to the following observations:
We store our login token in $XDG_RUNTIME_DIR/proxmox-backup/tickets. According to [1], $XDG_RUNTIME_DIR is set
by pam_systemd. Are you by any chance running your script via sudo, su or in a shell spawned by sudo/su. In the case of sudo, most environment variables are cleared, so $XDG_RUNTIME_DIR is not set anymore. In the case of su, the variable is inherited, but it's set to the wrong path, since the runtime dir belongs to the original user and not root.

If I'm right, login should work if you directly login as root and run your script, because then $XDG_RUNTIME_DIR will be set by pam_systemd.

I have taken the liberty to create a bugzilla issue for this [2]

[1] https://www.freedesktop.org/software/systemd/man/pam_systemd.html
[2] https://bugzilla.proxmox.com/show_bug.cgi?id=4346
 
  • Like
Reactions: Offf256
So, after some investigation, I've come to the following observations:
We store our login token in $XDG_RUNTIME_DIR/proxmox-backup/tickets. According to [1], $XDG_RUNTIME_DIR is set
by pam_systemd. Are you by any chance running your script via sudo, su or in a shell spawned by sudo/su. In the case of sudo, most

Yes, this is exactly the situation. Ja run it via sudo su - shell. And to make matters worse, login user does not even has home directory or env :)
I can not test it roght now but I will check environment variables and do some test during backup window and will give feedback.
 

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!