Skip to content

Instantly share code, notes, and snippets.

@robertsLando
robertsLando / influx_helper.js
Last active February 23, 2020 19:07
Influx DB (v 1.5.0+) Backup/Restore, Retention Policy and APIs helper
var Influx = require('influx');
var QL = require('influx-ql'); //influx query builder
var logger = require('../config/logger.js'); //winston logger
var configDB = require('../config/database.js'); //database constants configuration file
var cmd = require('node-cmd'); //to execute commands
var backup_path = __dirname + configDB.influx_backup; //path to temporary folder used to store backups files
// UTILS FUNCTIONS
function dateToNano(date){