Python tool to backup unifi event clips in realtime.
Project description
Unifi Protect Backup
A Python based tool for backing up Unifi Protect event clips as they occur.
- GitHub: https://github.com/ep1cman/unifi-protect-backup
- PyPI: https://pypi.org/project/unifi-protect-backup/
- Free software: MIT
Features
- Listens to events in real-time via the Unifi Protect websocket API
- Supports uploading to a wide range of storage systems using
rclone - Performs nightly pruning of old clips
Requirements
- Python 3.9+
- Unifi Protect version 1.20 or higher (as per
pyunifiproect) rcloneinstalled with at least one remote configured.
Installation
- Install
rclone.Instructions for your platform can be found here: https://rclone.org/install/#quickstart - Configure the
rcloneremote you want to back to. Instructions can be found here: https://rclone.org/docs/#configure pip install unifi-protect-backup
Usage
Usage: unifi-protect-backup [OPTIONS]
A Python based tool for backing up Unifi Protect event clips as they occur.
Options:
--address TEXT Address of Unifi Protect instance
[required]
--port INTEGER Port of Unifi Protect instance
--username TEXT Username to login to Unifi Protect instance
[required]
--password TEXT Password for Unifi Protect user [required]
--verify-ssl / --no-verify-ssl Set if you do not have a valid HTTPS
Certificate for your instance
--rclone-destination TEXT `rclone` destination path in the format
{rclone remote}:{path on remote}. E.g.
`gdrive:/backups/unifi_protect` [required]
--retention TEXT How long should event clips be backed up
for. Format as per the `--max-age` argument
of rclone`
(https://rclone.org/filtering/#max-age-don-
t-transfer-any-file-older-than-this)
-v, --verbose How verbose the logging output should be.
None: Only log info messages created by
`unifi-protect-backup`, and all warnings
-v: Only log info & debug messages created
by `unifi-protect-backup`, and all warnings
-vv: Log info & debug messages created by
`unifi-protect-backup`, command output, and
all warnings
-vvv Log debug messages created by `unifi-
protect-backup`, command output, all info
messages, and all warnings
-vvvv: Log debug messages created by `unifi-
protect-backup` command output, all info
messages, all warnings, and websocket data
-vvvvv: Log websocket data, command output,
all debug messages, all info messages and
all warnings [x>=0]
--help Show this message and exit.
The following environment variables can also be used instead of command line arguments (note, CLI arguments always take priority over environment variables):
UFP_USERNAMEUFP_PASSWORDUFP_ADDRESSUFP_PORTUFP_SSL_VERIFYRCLONE_RETENTIONRCLONE_DESTINATION
Credits
Heavily utilises pyunifiproect by @briis
This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unifi-protect-backup-0.1.0.tar.gz.
File metadata
- Download URL: unifi-protect-backup-0.1.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2113a4826e30ef9d26c879124ac41fdea0ab56a5653585389f98b64597ff2261
|
|
| MD5 |
2b61b48478a4daab3e6125d5b58c51e2
|
|
| BLAKE2b-256 |
1eb4df1c8858f7bd5a56e6247aa7da388d3092ba571c6c49e66199479d3cec63
|
File details
Details for the file unifi_protect_backup-0.1.0-py3-none-any.whl.
File metadata
- Download URL: unifi_protect_backup-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab8d36f461ddc362ff4fd10a1b1fe94178d0347dd3f1b085d08b673b47aebd8
|
|
| MD5 |
15f33547a8fd1ca61a2d48d02aec361c
|
|
| BLAKE2b-256 |
91eed9f52a441a524716e430f7695248e122d7a09645e9b147789cc6cfb6721d
|