npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-influxdb-backup

v0.1.0

Published

A node for backing up influx database using influxd backup

Downloads

118

Readme

node-red-contrib-influxdb-backup

A Node-RED node for performing influx database backup using influxd backup.

It creates a backup of the specified database in the configured folder, using portable mode.

Prerequisites

See the Influxdb docs for influxd backup in order to understand exactly how influx backup/restore works. In particular note the section about configuring bind-address in influxdb.conf. The node has been tested using influxdb 1.8.0, at the time of writing it is unclear whether the backup command has changed for Influxdb 2.0.

If the Influx database is on a remote server then influx must also be installed on the machine running node-red, so that the influxd command is available.

Install

Use the Node-RED Manage Palette menu option or run the following in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-influxdb-backup

Configuration and Inputs

Folder

The destination folder for the backup files, may be configured as a string or as a message attribute. If the folder does not exist then it will be created.

Database

The database to be backed up, may be configured as a string or as a message attribute. If this is missing or an empty string then all databases are backed up.

Host

The hostname or IP address of the machine running influxdb. Defaults to locahost. May be configured as a string or as a message attribute.

Port

The port to use to connect to influxdb. Defaults to 8088. May be configured as a string or as a message attribute.

Clear folder

If this is true then any previous backup files are deleted before the backup is run. May be configured as a boolean or provided as a message attribute (which must be boolean true or string "true", anything else is interpreted as false).

Unzip and rename files

If this is true then the backup files (which are .tar.gz files) are unzipped after the backup is performed, then they are all renamed from the standard format YYYYMMDDTHHMMSSZ.*.tar.gz to <prefix>.*.tar. In addition the manifest file contents are adjusted for the modified filenames. This is useful when using a regular backup strategy that uses incremental backups or some form of deduplication such as Borg or Back In Time. Most of the files in the influx backup do not change at each backup, so the backup strategy does not need to make new copies of them (the timestamps will be different but the contents the same). It is necessary to unzip the files as the original gz files do differ each time, I imagine the gz file includes the timestamps of the embedded files, which will be different. May be configured as a boolean or provided as a message attribute (which must be boolean true or string "true", anything else is interpreted as false).
If it is required to restore the backup it is just necessary to zip them up again, on linux gzip *.tar will suffice, then run the restore command as documented in the influx link earlier.

Prefix

When Unzip and rename is requested then this sets the filename to use. May be configured as a string or as a message attribute.

Start time

The start of the time range to backup may be provided by passing a string in msg.start. The string must be formatted exactly as defined in the Influxdb link above. For example "2020-06-01T12:00:00Z". If msg.start is not provided then the backup will be from the earliest data in the database.

End time

The end of the time range to backup may be provided by passing a string in msg.end. The string must be formatted exactly as defined in the Influxdb link above. For example "2020-07-01T12:00:00Z". If msg.end is not provided then the backup will be up to the latest data in the database.

Outputs

1. Standard Output

The standard output of the backup command. Multiple progress messages will be sent as the backup proceeds. This ouput is provided in case of problems, or to allow confirmation that the expected backup has been performed.

2. Standard Error

The standard error output from the backup command, and error messages from other actions. There may be multiple error messages.

3. Return Code

The payload is an object containing the attribute code containing the return code. Zero implies success. This message will be sent when the operation is complete.

Catch

A linked Catch node will send a message containing details of any error. There will be at most one Catch message. There will not be both Catch and Complete messages.

Complete

A linked Complete node will send a message on successful completion. No message will be sent if there is an error.