environment variables?

barrydocks

Member
May 3, 2023
35
2
13
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.
 
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
With PBS you use can also restore single files, even from full backups.