Simple no frills flow to auto backup NR flows to usb thubmdrive

Hi All,
Like many i have a few Pis with NR dotted all over the place. Probably unlike many, I have not been doing backups religiously and I guess it is only a question of when not if, one of the Pi gets corrupted or the sd card crap out and I will be kicking myself.
A search thru the forum yield numerous methods for performing backup, however all I want is a no frills auto backup to a usb drive attach to the Pi (I have collected many usb drives thru the years and most are just idle layabouts which i have forgotten what was on them, so an opportunity to use them).
This is a very simple no frill flow that simply just backup the 3 essential nr flow json files on to a usb drive attached to the Pi.
By changing frequency of the inject node, one can perform auto daily backup at say 3 am in the morning or whatever take your fancy.
I have yet try to restore yet, so fingers crossed.
Of course one could add further flows to rename the files with multiple generations, store the files on the cloud, send you a email etc.. but as then it wont be a simple no frills approach as eluded in the title.
You will need to obviously change the full path and name of your usb drive.
Hope it would be useful for some.

[{"id":"e686f05a.a1d71","type":"file in","z":"89f54abf.a5fc8","name":"flows_raspberrypi.json","filename":"/home/pi/.node-red/flows_raspberrypi.json","format":"utf8","sendError":true,"x":576.1667175292969,"y":290.1666564941406,"wires":[["8380856e.150cb8"]]},{"id":"45db5ad.0d4cba4","type":"file in","z":"89f54abf.a5fc8","name":"flows_raspberrypi_cred.json","filename":"/home/pi/.node-red/flows_raspberrypi_cred.json","format":"utf8","sendError":true,"x":581.1668395996094,"y":344.1666564941406,"wires":[["7e839b28.163044"]]},{"id":"7e839b28.163044","type":"file","z":"89f54abf.a5fc8","name":"Save file to usb drive","filename":"/media/pi/F077-00D1/nr_flows_bak/flows_raspberrypi_cred.json","appendNewline":false,"createDir":false,"overwriteFile":"true","x":835.1666870117188,"y":343.1666564941406,"wires":[[]]},{"id":"88b2af5c.e43aa","type":"inject","z":"89f54abf.a5fc8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":324.3333740234375,"y":351.5,"wires":[["45db5ad.0d4cba4","e686f05a.a1d71","50113098.e3558"]]},{"id":"8380856e.150cb8","type":"file","z":"89f54abf.a5fc8","name":"Save file to usb drive","filename":"/media/pi/F077-00D1/nr_flows_bak/flows_raspberryp.json","appendNewline":false,"createDir":false,"overwriteFile":"true","x":834.1666870117188,"y":294.1666564941406,"wires":[[]]},{"id":"7d884a11.aa62ec","type":"file","z":"89f54abf.a5fc8","name":"Save file to usb drive","filename":"/media/pi/F077-00D1/nr_flows_bak/pakage.json","appendNewline":false,"createDir":false,"overwriteFile":"true","x":840.1666870117188,"y":396.1666564941406,"wires":[[]]},{"id":"50113098.e3558","type":"file in","z":"89f54abf.a5fc8","name":"package.json","filename":"/home/pi/.node-red/flows_raspberrypi.json","format":"utf8","sendError":true,"x":551.166748046875,"y":398.1666564941406,"wires":[["7d884a11.aa62ec"]]}]

3 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.