environment variables?

barrydocks

New Member
May 3, 2023
29
0
1
Please can someone explain how environment variables work and I can use them to make an automated backup script with api key access?
 
Either inside the same script or an external „script“ (actually just a file with one key/value pair per line) and included by

Code:
source <path to file>
 
I would suggest you read a tutorial on shell programming and some existing script and try to tweak it, this should clear most questions:
https://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
https://tldp.org/LDP/abs/html/

https://www.freecodecamp.org/news/b...-shell-script-and-command-line-for-beginners/

What I don't understand though why you would need to create a script to do backups with an api key. The native WebUI of ProxmoxVE and PBS allows (if you configured permissions correctly) to run scheduled backup jobs for lxcs and vms without creating your own shell script.
 
What I don't understand though why you would need to create a script to do backups with an api key. The native WebUI of ProxmoxVE and PBS allows (if you configured permissions correctly) to run scheduled backup jobs for lxcs and vms without creating your own shell script.
I want to back up a couple of individual files and directories off one of the VMs to give instant access to them in the event of a problem as it might take some time to restore the full VM image especially in the event of a hardware failure
 
What I don't understand though why you would need to create a script to do backups with an api key. The native WebUI of ProxmoxVE and PBS allows (if you configured permissions correctly) to run scheduled backup jobs for lxcs and vms without creating your own shell script.

I use it to backup nodes of a Proxmox cluster with proxmox-backup-client. That way I can keep configuration away from logik.
 

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!