PostgreSQL Backup Manager
PostgreSQL Backup Manager is a backup solution for PostgreSQL databases running on Windows. It automates backups using PostgreSQL’s native pg_basebackup utility and includes features such as scheduling, notifications, and post-backup automation.
Installation
PostgreSQL Backup Manager is installed and updated through Monitor Installation Manager. The installation creates a desktop shortcut. If the shortcut is not available, you can start the application manually. The default location for PostgreSQL Backup Manager is: "C:\Program Files\Monitor ERP System AB\MONITOR Postgres Backup\Monitor.Postgres.Backup.Manager.exe".
Status & Log
The Status & Log tab shows the current state of your backup system and provides a history of recent backup operations.
-
Backup Agent Status: Shows whether the backup agent service is installed and running on your system. Possible statuses are Running, Stopped, Paused, och Not installed.
-
Last Backup: Displays the date and time of the most recent successful backup.
-
Last Duration: Shows how long the most recent backup took to complete.
-
Next Backup: Indicates when the next scheduled backup will run.
-
Open logs folder: Opens the folder containing detailed backup logs, which are retained for 30 days.
-
Backup History: Displays the 50 most recent backup operations, including their status, duration, and backup type.
-
Refresh: Reloads the current status and backup history.
Settings
Use this tab to configure the core backup settings and PostgreSQL connection details.
-
Backup directory: The Windows path where backup files will be stored (for example, C:\Backups\PostgreSQL). Make sure this location has enough available disk space.
-
PostgreSQL binaries directory: The path to your PostgreSQL installation’s bin folder, where pg_basebackup.exe is located (for example, C:\Program Files\PostgreSQL\18\bin).
-
Host name (PostgreSQL): The host name or IP address of your PostgreSQL server. Use “localhost” for local installations.
-
Port: The PostgreSQL server port. The default value is 5432.
-
Login username (PostgreSQL): A PostgreSQL user account with replication privileges or superuser access. The default username is “Postgres”.
-
Login password (PostgreSQL): The password for the PostgreSQL user account. It is stored securely in encrypted form.
Click Save Settings to apply your changes.
Scheduling
Use this tab to define when scheduled backups should run.
-
Full backup time: The time when the daily full (base) backup should run, using 24-hour format.
An initial backup will be performed immediately after installation is completed. Subsequent backups will run according to the schedule.
Click Save Schedule to apply the schedule.
Notifications
Use this tab to configure e-mail notifications for backup events. You can create multiple notification rules with different triggers.
-
Name: A descriptive name for the notification rule (for example, “E-mail to IT” or “Alert on Failure”).
-
Trigger when: Select when the notification should be sent.
-
Backup succeeds: Sends a notification when a backup completes successfully.
-
Backup fails: Sends a notification when a backup encounters an error.
E-mail methods
The application currently supports only SMTP.
SMTP
-
SMTP Host: Server address (e.g., smtp.gmail.com, smtp.office365.com).
-
SMTP Port: Server port (common: 587 for TLS, 465 for SSL, 25 for unencrypted).
-
SMTP Username: Your e-mail account username.
-
SMTP Password: Your e-mail account password or app-specific password.
-
Use SSL/TLS: Enable encrypted connection (recommended).
-
Sender E-mail: E-mail address that will appear as the sender.
-
Recipient E-mail: E-mail address that will receive the notifications.
Test Notification: Use the Test Notification button in the dialog to verify your e-mail configuration before saving.
Click Add New Notification to create a new notification rule. Use the edit (pencil) and delete (trash) icons in the Actions column to manage existing notifications.
Advanced
Post-backup hooks allow the backup agent to run one or more external commands after each backup is completed. Hooks are useful for automating follow-up actions such as copying a backup to another location, uploading it, or sending a custom notification. The list shows all configured hooks and their settings.
Important: The command path must point to a valid executable file or script on the machine where the backup agent runs. Make sure the backup agent service account has permission to start the command and access any folders or network locations used by the hook.
How post-backup hooks work
-
A hook runs after a backup finishes, regardless of whether the backup succeeded or failed.
-
You can configure multiple hooks.
-
Hooks are run in a fire-and-forget manner, which means they do not block the backup schedule.
-
Each hook runs the command you configure and receives information about the completed backup.
Add New Hook
Click Add New Hook to open a dialog box where you can configure a new hook. The dialog includes the following settings:
-
Enabled: Determines whether the hook will run.
-
Command: The path to the executable file or script that should be run.
-
Parameter Mode: Controls how backup information is passed to the hook. The available options are CommandLine and EnvironmentVariables.
-
Timeout (seconds): The maximum time the hook process is allowed to run before it is terminated.
Parameter Modes
CommandLine: Backup information is passed to the command as command-line arguments.
| Argument | Description | Example |
|---|---|---|
| --status | Backup result: Success or Failure. | --status Success |
| --backup-directory | Path to the backup directory. | --backup-directory E:\Backups\base_backup |
| --start-time | Backup start time in ISO 8601 format (UTC). | --start-time 2025-06-12T02:00:00.0000000Z |
| --finish-time | Backup finish time in ISO 8601 format (UTC). | --finish-time 2025-06-12T02:15:00.0000000Z |
| --backup-type | Type of backup performed: Full or Incremental. | --backup-type Full |
| --error | Error message if the backup failed. Empty when the backup succeeded. | --error "" |
| --test-run | True if this is a test execution, otherwise False. | --test-run False |
Environment variables
EnvironmentVariables: Backup information is passed to the command through environment variables.
| Variabel | Description |
|---|---|
| MONITOR_BACKUP_STATUS | Backup result: Success or Failure. |
| MONITOR_BACKUP_DIRECTORY | Path to the backup directory. |
| MONITOR_BACKUP_START_TIME | Backup start time in ISO 8601 format (UTC). |
| MONITOR_BACKUP_FINISH_TIME | Backup finish time in ISO 8601 format (UTC). |
| MONITOR_BACKUP_TYPE | Type of backup performed: Full or Incremental. |
| MONITOR_BACKUP_ERROR | Error message if the backup failed. Empty when the backup succeeded. |
| MONITOR_BACKUP_TEST_RUN | True if this is a test execution, otherwise False. |