Skip to main content

Usage

pfsense-backup is a simple tool to fetch configuration backups from the pfSense firewall.

Arguments

-h, --help

show the help message and exit.

-c FILE, --config FILE

the configuration file (default: ~/.config/pfsense-backup/config.yml)

-o FILE, --output FILE

the output file. The file name can contain strftime directives. If the argument is specified, directory, name and keep fields of the configuration are ignored.

Configuration file

The pfsense-backup needs a configuration file (default ~/.config/pfsense-backup/config.yml). As the file contains secrets, take care to set reasonable permissions. The file is in the YAML format.

Configuration file

pfsense:
   url: https://pfsense
   user: admin
   password: ...
   ssl_verify: true|false|/path/to/custom_cert.pem
output:
   directory: .
   name: "pfsense-%Y%m%d-%H%M.xml"
   keep: 12

All fields except password are optional.

host is a host name or an IP address.

name specifies the name of the output file. strftime directives are allowed.

keep removes all but the most recent *.xml files from the directory, that in this case has to be specified and has to be an absolute path.

directory has to already exist. As the backup is not encrypted and contains secrets the permissions should be set accordingly.

Observability

The backups done can be exported through prometheus text-file format and consumed by the node exporter’s textfile collector. If the metrics key exists, the file is atomically populated after each backup run.

metrics:
    directory: "/var/local/lib/prom_metrics"
    suffix: "my-pfsense"

directory is mandatory and specifies the path of the directory passed as the --collector.textfile.directory for the node_exporter. It has to already exist. suffix is optional and will be appended to the file name to distinguish metrics files generated by different configurations. For the above configuration the full file name will be /var/local/lib/prom_metrics/pfsense-backup-my-pfsense.prom.

Metadata

Release files for pfsense-backup 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pfsense-backup 0.2.4
File Size Uploaded
pfsense_backup-0.2.4.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pfsense-backup 0.2.4
File Interpreter ABI Platform
pfsense_backup-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / pfsense_backup-0.2.4.tar.gz

Download URL pfsense_backup-0.2.4.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed6a0970fc8f7e7584e364470eb582e0b0d1ca143337263bc9c51caa45e689fa
BLAKE2b-256 checksum
How to use checksums
c3f286d16f0f767d73facda2a75b7bd5acd9622e3e8dbfd049e13d32120c505b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Release files / pfsense_backup-0.2.4-py3-none-any.whl

Download URL pfsense_backup-0.2.4-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
694ac72b6ab5cb0ba0ef99f3004f866f5390293210ce9db934a6aa2b1648843a
BLAKE2b-256 checksum
How to use checksums
329c5d72c0d25fd64b5ff14f030d6f5c56a67e8a426b215a1ec589b30dba25ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page