This is a new node that makes a backup of an Influxdb database, using
It also adds some added value to that command.
The influxd backup command backs up one or all databases from a server to a folder and creates a set of .tar.gz files (plus manifest and meta files). The files are named in a format which includes the current time,
YYYYMMDDTHHMMSSZ.*.tar.gz. Also there can be only one backup in a folder as the influxd restore command cannot cope with more than one in a folder. This is particularly unhelpful if the backup is part of a regular strategy that uses differential or deduplicated backups, such as Back in Time or Borg. The fact that each time a backup is performed it has to go to a new folder (unless the original files are deleted first) and the fact that the names are different each time can make the whole thing complicated. In addition a deduplicating backup app like Borg cannot make use of the fact that most of the backup files will be identical each time (for old data), not because the filenames change as Borg copes with that, but because the files are zipped the file contents are not the same each time (I guess the zip includes timestamps for the embedded files).
To ease the situation the node has a couple of features:
- It has an option to remove old backup files from the folder specified.
- It has an option to unzip the files (to
.tarfiles), which makes files containing old data the same as at the last backup, and to rename the files to a predefined name. This means that the backup folder is largely unchanged each time a backup is performed, with just the addition of the most recent data. If it is required to restore from these files it is merely necessary to zip them up again before running the restore command (
If anyone has any interest in this node I would be most grateful if they could give it a go. There should be no chance of it damaging the influx data as it only uses
influxd backup to access the server. In particular if anyone can check it on an alternative OS that would be good as I only have access to Ubuntu and Raspbian.
I have not published to npm yet so to install it run, from the .node-red folder
npm install colinl/node-red-contrib-influxdb-backup
Version is currently 0.0.1. You will need to have git installed to do that. Once it has been published to npm then that will not be the case.
The readme and help are hopefully reasonably complete, but please also comment on any areas that need clarification there.
Documentation on the influx command can be found here. In particular see the section in there about configuring
influxdb.conf which is necessary to allow the backup command to work.
Which reminds me, I put that in the readme, but not in the help text I think, so that needs to go on the list.