On this page

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_DATA_DIR

pdc-server

Data directory of the server (catalog, PKI, logs, packages, server.toml). Equivalent to the global parameter --data-dir; the parameter wins.

Windows C:\ProgramData\PDC-Backup\server, Linux /var/lib/pdc-backup

PDC_AGENT_DIR

pdc-agent

State directory of the agent (identity, certificates, logs). Equivalent to --state-dir.

Windows C:\ProgramData\PDC-Backup\agent, Linux /var/lib/pdc-agent

PDC_ENROLL_TOKEN

pdc-agent enroll, Windows install

One-time enrollment token. Equivalent to --token and keeps the token out of the process list and the shell history. The pull command of the web interface and the server's push pass the token this way, too.

โ€“

PDC_LOG

all programs

Log level, for example debug or info. Applies to console and log file. An invalid value falls back to info.

info

PDC_S3_ACCESS_KEY_ID

pdc-server dr restore

Access key ID for an S3 repository as the restore source. Equivalent to --s3-access-key-id.

โ€“

PDC_S3_SECRET_ACCESS_KEY

pdc-server dr restore

Secret access key. Equivalent to --s3-secret-access-key.

โ€“

PDC_S3_REGION

pdc-server dr restore

Region of the S3 repository. Equivalent to --s3-region.

โ€“

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

PDC_PHASE

pre or post

PDC_JOB_ID

ID of the job

PDC_JOB_NAME

Name of the job

PDC_RUN_ID

ID of the run

PDC_RUN_KIND

backup

PDC_WORKLOAD

Workload of the job (for example files)

PDC_AGENT_ID

ID of the agent

PDC_HOSTNAME

Host name of the agent

PDC_REPOSITORY_ID

ID of the repository

PDC_STATUS

Post script only: result success, warning, failed or cancelled

PDC_SNAPSHOT_ID

Post script only: ID of the snapshot created, if there is one

PDC_ERROR

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).

Last updated Nov 16, 2026