[SOLVED] backups from cron | api

mouk

Active Member
May 3, 2016
37
0
26
51
Hi,

Trying to setup a cron job, for doing regular backups to PBS. Trying to use an API token for authentication.
I selected my backup-user, created an API token. And now want to use that token with my backup command:

Code:
root@server:~# proxmox-backup-client backup root.pxar:/ --repository backupuser@pbs!cabddd7-9fddc7-4adds9-b8f7-26625@1.2.3.4:our-backup-storage --include-dev /var

-bash: !cabddd7: event not found

So this is not working. :-|

I am trying to avoid having the backupuser plaintext password on the client. Is the above not the way to achieve that..?
 
Hey,

try putting the repository in single quotes ', bash uses the ! if it is not escaped.
 
Hi Hannes!

I escaped like \!, because I was unsure where to start quoting. This gets me further, new error:
Code:
root@server:~# proxmox-backup-client backup root.pxar:/ --repository root@pam\!cab1a7-9f-4xxxxxab9-b7-26bf4625@1.2.3.4:backup-repo --include-dev /var
Error: error building client for repository root@pam\!cab1a7-9f-4xxxxxab9-b7-26bf4625@1.2.3.4:backup-repo - API token secret must be provided!

Is my formatting of the repo wrong..? I AM providing the secret, as I understand it...
 
The docs should be more clear, the thing after the ! has to be the name of the token name, the secret has to be in the environment variable PBS_PASSWORD.

So basically:
export PBS_PASSWORD=<secret>
and then
proxmox-backup-client backup root.pxar:/ --repository backupuser@pbs!<token_name>@1.2.3.4:our-backup-storage --include-dev /var
 
  • Like
Reactions: Maksel
Right! So the environment variable is always required. That helps, thanks Hannes. Agreed on the documentation. Specifically some more examples would help for understanding better. :)
Anyway, it works now, except this:
Code:
"Error: backup owner check failed (root@pam!server != root@pam)
I guess changing the ownership of an existing backup is simply not yet implemented..?
Thanks a lot Hannes!
 
Ah I found post on changing ownership: You can manually change the owner (it's in the file called 'owner' in the backup group dir)
All is well now! :)
 

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!