Skip to content

Plugin ospy backup

Martin Pihrt edited this page Oct 13, 2026 · 1 revision

OSPy package Backup

Creates downloadable ZIP archives of installed plug-in data directories.

At a glance

Item Value
Version 1.0.5
Category Network, data and system maintenance
Author Martin Pihrt
License GPL-3.0
OSPy 3.0.211 or newer
Python 3.8 or newer
Permissions files
Hardware No dedicated hardware requirement declared
Dependencies None
Python/OS packages None
Interfaces provider ospy.provider.v1, Mobile API v1
Source Open the plug-in directory

What it is for

Creates downloadable ZIP archives of installed plug-in data directories.

How it works and how to configure it

Tested in Python 3+

Version 1.0.5 implements ospy.provider.v1, declares an explicit Automation Rules action and exposes guarded mobile create/download controls for the newest plug-in data ZIP. Mobile metrics use stable IDs and declare last_backup_size as quantity=data_size with unit B, allowing clients to format the byte count for display. Concurrent requests remain rejected and the resulting file name and size are returned to action history.

The mobile manifest declares action ID create_backup with an empty JSON payload and download ID latest_backup. After a successful creation, the mobile card advertises the available ZIP; mobile_download('latest_backup') returns only its verified path, base file name and application/zip MIME type for streaming by the matching OSPy Mobile API endpoint. This is a plug-in-data archive and is separate from complete OSPy system backups.

This extension creates a backup of data directories from all available installed extensions in OSPy. Example: "Air Temperature and Humidity Monitor/data". Local records from plugins (for example json files with temperature, etc...) are most often found in the plugins data directories. Backups can be downloaded to our computer (phone) and possibly uploaded back to data directories in specific plugins after unpacking. Backups are in zip format (example: 20240417-201606-PluginsBackup.zip. If possible, store all records from the plugins on to your own database storage (MySQL) instead of in local "data" directories. Not only does this save the Raspberry Pi SD card, but in the event of an OSPy crash, we won't lose the saved data (since it's outside of OSPy in the database). To connect to the database, we can use an extension called: database_connector. Which will ensure the storage of data from our plugins.

The plug-in includes an OSPy plugin.json manifest and implements the common lifecycle and health() interfaces. Its former one-shot worker was removed because backups are created synchronously on request. Concurrent backup requests are rejected, and a stop request is checked between copied plug-in data directories. Diagnostics reports an active backup, the latest successful archive name and size, and the latest failure or cancellation. The latest successful archive is discovered from the plug-in data directory, so its status remains available after OSPy or the plug-in is restarted.

In-app help and settings notes

The following notes are generated from the help page shipped with this plug-in. Field names are also explained directly in the OSPy settings page.

This extension creates a backup of data directories from all available installed extensions in OSPy. Example: "Air Temperature and Humidity Monitor/data". Local records from plugins (for example json files with temperature, etc...) are most often found in the plugins data directories.

Backups can be downloaded to our computer (phone) and possibly uploaded back to data directories in specific plugins after unpacking. Backups are in zip format (example: 20240417-201606-PluginsBackup.zip)

If possible, store all records from the plugins on to your own database storage (MySQL) instead of in local "data" directories.

Not only does this save the Raspberry Pi SD card, but in the event of an OSPy crash, we wont lose the saved data (since its outside of OSPy in the database).

To connect to the database, we can use an extension called: database_connector. Which will ensure the storage of data from our plugins.

Automation Rules can explicitly create a plug-in data backup through the same protected backup operation. Concurrent backup requests are rejected.

Support

Check OSPy → Diagnostics first and remove passwords, tokens, private addresses and other secrets before sharing logs. Report reproducible plug-in problems in the OSPy-plugins issue tracker.

Back to the plug-in catalog

Clone this wiki locally