How many times you modify a flow and lost something from the previouse one? never? I don't think so ... it happen to me many times :( especially if I open flows from different computers.
So some months ago I wrote a simple flow for backup all the working flow at every commit of Node-RED.
The script simply backup the following file:
/root/.node-red/flows_vps.json /root/.node-red/flows_vps_cred.json cloning in the same directory with a new name with timestamp. In order to make it work from your computer remember to:
- change the path with the right one for your instance,
- change the names of the files using the format flow_YourHostname.json and flow_YourHostname_cred.json
In order to make it work modify the actual URL in file and function nodes checking your enviroment url and filenames.
Both files are timestamped using the opentimestamp protocol (generating other 2 files with suffix ots).
- node-red-node-pushover a tool for receive notifications on mobile/tablet/desktop (take care! it's not totally free... but work well - OPTIONAL, if you dont like delete it)
- node-red-contrib-opentimestamps a collection of Node-RED nodes useful for access the OpenTimestamps services.
Valerio Vaccaro - valeriovaccaro.it
After a day of coding, I have more than 50 files in my folder....