Hi,
currently I'm trying to run the backups via crontab.
I'll keep the examples as small as possible, therefore I explain my problem using the proxmox-backup-client list command.
When I run the command in the CLI directly (logged in as root on my Proxmox server), everything is working as intended.
Then I created two files.
When I run the script directly in the CLI it still works but as soon as I run it via cron or via
it does not work and I get the error message
I already read many threads here but nothing seems to work. I may miss something obvious here but I just can't see it.
Does anyone has an idea what I'm doing wrong?
Thank you very much
currently I'm trying to run the backups via crontab.
I'll keep the examples as small as possible, therefore I explain my problem using the proxmox-backup-client list command.
When I run the command in the CLI directly (logged in as root on my Proxmox server), everything is working as intended.
Bash:
proxmox-backup-client list --repository 'user@pbs!Token@IPv4:Datastore'
Then I created two files.
- .pbs.env containing
-
Bash:
PBS_REPOSITORY=user@pbs!Token@IPv4:Datastore PBS_PASSWORD=secret
-
- pbs-test.sh containing
-
Bash:
#!/bin/bash source /root/.pbs.env proxmox-backup-client list --repository "$PBS_REPOSITORY"
-
When I run the script directly in the CLI it still works but as soon as I run it via cron or via
Code:
env -i /root/pbs-test.sh
Error: error building client for repository user@pbs!TockenName@IPv4: DatastoreName - API token secret must be provided!
I already read many threads here but nothing seems to work. I may miss something obvious here but I just can't see it.
Does anyone has an idea what I'm doing wrong?
Thank you very much