hi
I'm fairly new to node-red and am trying to automate execution of a command.
A bit of background. I am setting up a number of IOT sensors to collect data for a project I have. I am using a MING (Mosquitto, InfluxDB, Node-red, and Grafana) stack to collect the data points from the sensors, store them (influxdb) and display them. For now the server is running on a raspberry pi. I've used docker to set up the MING stack and it is running well.
I now would like to set up a backup for the InfluxDB database. I have mounted a shared folder back to my NAS at /home/dr/lab_data to hold it. Docker provides a command to export containers (eg Influxdb) into a .tar file.
sudo docker export -o /home/dr/lab_data/ influxdb
I can execute the command manually and it creates a .tar file in the location and now would like to automate this in code red.
I haven't been able to get the exec node to work.
simply inserting the above command returns error 127 with ...
Command failed: sudo docker export -o /home/dr/lab_data/test influxdb
/bin/bash: line 1: sudo: command not found
I have tried including the command in the injected message payload but this doesn't work.
any constructive suggestions would be welcome