Skip to main content

A simple tool to fetch backups from the UniFi Network Application

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unifi_backup-0.2.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unifi_backup-0.2.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file unifi_backup-0.2.1.tar.gz.

File metadata

  • Download URL: unifi_backup-0.2.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for unifi_backup-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cd170ca9275859c6be70689651fed2151c494de7b912e28075f64197b8193d06
MD5 2feeb16d86ba7248358a91f6385a5b41
BLAKE2b-256 00fb6c02ded07d2a5cd62eb838f934b8e0839f389c4733b2b634645a40c40aa4

See more details on using hashes here.

File details

Details for the file unifi_backup-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: unifi_backup-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.15

File hashes

Hashes for unifi_backup-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3195c3a4fbf95c8f457dc5f00380f0b04acdc11535c17ca91cb6d1dda7e1a392
MD5 213a70b9475f57bff338845029dc42bd
BLAKE2b-256 6eff72f4b7c456f1497c5f55b96631a46e8a0e9a288aeb9e6239a41954364182

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page