13.4 Environment variables
PDC-Backup reads only a few environment variables. Most of them replace a command-line parameter so that secrets do not appear in the process list. This page separates the variables that server and agent evaluate from the variables for the pre and post scripts of jobs.
Variables for server, agent and helper programs
The variables come from the process environment. For a service, that means the service's settings (Windows: system environment, Linux: Environment= in a systemd drop-in file).
Variable | Applies to | Effect | Default |
|---|---|---|---|
| pdc-server | Data directory of the server (catalog, PKI, logs, packages, | Windows |
| pdc-agent | State directory of the agent (identity, certificates, logs). Equivalent to | Windows |
| pdc-agent | One-time enrollment token. Equivalent to | โ |
| all programs | Log level, for example |
|
| pdc-server | Access key ID for an S3 repository as the restore source. Equivalent to | โ |
| pdc-server | Secret access key. Equivalent to | โ |
| pdc-server | Region of the S3 repository. Equivalent to | โ |
Examples:
# Windows: enroll the agent with the token from the environment
$env:PDC_ENROLL_TOKEN = '<token>'
& "C:\Program Files\PDC-Backup Agent\pdc-agent.exe" install --server https://backup-pc:8444
Remove-Item Env:PDC_ENROLL_TOKEN
# Linux: start the server in the foreground temporarily with more log output
sudo -u pdc-backup PDC_LOG=debug /usr/bin/pdc-server run
Logs are JSON lines in <data directory>/logs (server) or <state directory>/logs (agent), rotated daily, with 30 files kept.
Variables for pre and post scripts
Scripts that run before and after a backup job get these variables from the agent (see chapter 06 Jobs).
Variable | Content |
|---|---|
|
|
| ID of the job |
| Name of the job |
| ID of the run |
|
|
| Workload of the job (for example |
| ID of the agent |
| Host name of the agent |
| ID of the repository |
| Post script only: result |
| Post script only: ID of the snapshot created, if there is one |
| Post script only: error message if the run failed |
The script's output goes into the run log line by line (standard output as info, standard error as warnings).
Operating system variables that are read
Windows: ProgramData (default paths of server and agent, fallback C:\ProgramData), ProgramFiles (install folder of the agent), PATH (search for helper programs), COMPUTERNAME (host name), SystemRoot, LOCALAPPDATA (tray icon). Linux: PATH and INVOCATION_ID (this is how the agent detects that systemd started it).