Sebastian Goscik f453e77301 Update README.md
typo
2022-02-20 02:19:47 +00:00
2022-02-18 22:35:16 +00:00
2022-02-19 11:53:22 +00:00
2022-02-18 01:24:02 +00:00
2022-02-18 01:24:02 +00:00
2022-02-18 22:35:16 +00:00
2022-02-18 01:24:02 +00:00
2022-02-18 01:24:02 +00:00
2022-02-19 22:29:09 +00:00
2022-02-19 22:29:09 +00:00
2022-02-20 02:19:47 +00:00
2022-02-18 22:35:16 +00:00

Unifi Protect Backup

pypi python Build Status codecov

A Python based tool for backing up UniFi Protect event clips as they occur.

The idea for this project came after realising that if something were to happen, e.g. a fire, or a burglary that meant I could no longer access my UDM, all the footage recorded by all my nice expensive UniFi cameras would have been rather pointless. With this tool, all motion and smart detection clips are immediately backed up to off-site storage thanks to rclone, and kept for the configured retention period.

Buy me a coffee

Features

Requirements

  • Python 3.9+
  • Unifi Protect version 1.20 or higher (as per pyunifiproect)
  • rclone installed with at least one remote configured.

Installation

  1. Install rclone. Instructions for your platform can be found here: https://rclone.org/install/#quickstart
  2. Configure the rclone remote you want to backup to. Instructions can be found here: https://rclone.org/docs/#configure
  3. 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_USERNAME
  • UFP_PASSWORD
  • UFP_ADDRESS
  • UFP_PORT
  • UFP_SSL_VERIFY
  • RCLONE_RETENTION
  • RCLONE_DESTINATION

Credits

Languages
Python 97.8%
Dockerfile 1.5%
Makefile 0.7%