[SOLVED] Changing owner and cron backup of directory

DynFi User

Renowned Member
Apr 18, 2016
152
17
83
49
dynfi.com
I am pulling my hair trying to have a cron based backup setup.
First I am trying to have this command working without being croned and it doesn't!

The global semantic with the proxmox-backup-client is really very confusing.

I have managed to do the initial backup using root@pam account with no problem.
Now I am trying to move this to a more automated and secured way using auth token (I don't want my root passwd to be exposed anywhere on any file).

So I have decided to change the owner of the first backup to my user@pbs!token but it keeps no saying that I have "no permission on datastore".
The datastore seems to be considered as the Global Datastore and note the directory where I want to actually backup.


Code:
root@proxmaster:/etc# proxmox-backup-client backup mailao-archive.pxar:/mnt/pve/Macropus_mailao/ --repository 'gregober@pbs!gregober_PBS@192.168.21.3:BackupPMX'
Starting backup: host/proxmaster/2021-04-09T15:49:45Z
Client name: proxmaster
Starting backup protocol: Fri Apr  9 17:49:45 2021
Error: no permissions on '/datastore/BackupPMX'


But my permission seems "ok" and have been set correctly (AFAICT):

Code:
root@proxmaster:/etc# proxmox-backup-client change-owner host/proxmaster 'gregober@pbs!gregober_PBS' --repository 192.168.21.3:BackupPMX
Password for "root@pam": **********


I have set the token using the environment variable :

Code:
root@proxmaster:/etc# export PBS_PASSWORD="90ded90d-token_id_token_id-ef0f70e9adcb"


I am not sure what to do, if I need to set another DataStore ?
 
also, what permissions did you give the token? by default a user token has no permissions at all, you first have to assign it (note that even though you can set 'higher' permissions for the token than your user has, the actual permissions are the intersection of the permissions of the token and user)
 
It looks like the permission set through the GUI are not fully functional.

I was able to set this using the associated CLI and managed to get the permission set "ok".

I managed to get the backup flowing using the following cron script :

Code:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PBS_PASSWORD="52acxxxx-pbs-pbs-pbs-xxx1d3ab7b"

15 6,20 * * * root proxmox-backup-client backup mail-archive.pxar:/mnt/pve/srv_newmail/ --exclude /mnt/pve/Macropus_newmail/domain.com mailao-archive.pxar:/mnt/pve/srv_mailao/ --repository 'remotebckp@pbs!remote_bckp@192.168.21.3:BackupMail'


Somehow the '--exclude' section didn't work either.
 
Last edited:
It looks like the permission set through the GUI are not fully functional.
what do you mean? what did you set, what did you expect and what did not work?

Somehow the '--exclude' section didn't work either.
how do you mean? afaics the excluded path is not contained in the other two anyway?
 

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!