Skip to main content

Usage

unifi-backup is a simple tool to fetch configuration backups from the UniFi Network Application.

Arguments

-h, --help

show the help message and exit.

-c FILE, --config FILE

the configuration file (default: ~/.config/unifi-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 unifi-backup needs a configuration file (default ~/.config/unifi-backup/config.yml). As the file contains secrets, take care to set reasonable permissions. The file is in the YAML format.

Configuration file

controller:
   host: unifi
   port: 8443
   user: admin
   password: ...
   site: default
   ssl_verify: true|false|/path/to/custom_cert.pem
   version: UDMP-unifiOS|v4|v5|unifiOS
output:
   directory: .
   name: "unifi-%Y%m%d-%H%M.unf"
   keep: 12

All fields except password are optional.

host is a host name or an IP address. The host has to be the same as the network application is configured for; using unifi here and unifi.domain.lan won’t work.

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

keep removes all but the most recent *.unf 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-unifi"

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/unifi-backup-my-unifi.prom.

Metadata

Release files for unifi-backup 0.3.0

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

Source distribution (sdist)

Source distribution for unifi-backup 0.3.0
File Size Uploaded
unifi_backup-0.3.0.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unifi-backup 0.3.0
File Interpreter ABI Platform
unifi_backup-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / unifi_backup-0.3.0.tar.gz

Download URL unifi_backup-0.3.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d6cdfe317f3ce4e4761ac2d279d03c5ca177948382b5af78f8a895b9a3de16ae
BLAKE2b-256 checksum
How to use checksums
82d649054539b2190b6058f7ac1979fe5c7a8fe492d16212685d3a1a6dc1ac0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / unifi_backup-0.3.0-py3-none-any.whl

Download URL unifi_backup-0.3.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa18ab026f15c861a86d90d2ada56c59a7706a1313ba5cbdf2cac25e28b0fe2d
BLAKE2b-256 checksum
How to use checksums
da8f02753056eb095e3fde3d86bd01aa30de52de8bcbb534e6f8475b238e1414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.2

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