Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Node-RED flow to run backup script
[{"id":"840f46f8.ce38c8","type":"tab","label":"backup Server","disabled":false,"info":""},{"id":"c987f084.d5b","type":"exec","z":"840f46f8.ce38c8","command":"echo om | sudo -S /srv/openhab2-conf/.backup/acript.sh","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":549,"y":122,"wires":[["ba0dab80.458cd8","eb80b45a.926ae8"],[],["3b3ad18f.f6967e"]]},{"id":"ca29d8b7.3ca738","type":"inject","z":"840f46f8.ce38c8","name":"","topic":"","payload":"","payloadType":"date","repeat":"36000","crontab":"","once":false,"onceDelay":0.1,"x":137,"y":53.5,"wires":[["c987f084.d5b","f8c7a781.0a2b88"]]},{"id":"d2d4af1e.f8a2d","type":"openhab2-in","z":"840f46f8.ce38c8","name":"","controller":"e3ae80.b3c1018","itemname":"runBackupOutputStatus","x":119.5,"y":101,"wires":[["544e5475.653dec"],[]]},{"id":"b9749575.d04238","type":"openhab2-out","z":"840f46f8.ce38c8","name":"","controller":"e3ae80.b3c1018","itemname":"runBackupOutputExitVal","topic":"ItemUpdate","payload":"","x":1110.5,"y":164,"wires":[["ca5abdd1.3ac74"]]},{"id":"3b3ad18f.f6967e","type":"function","z":"840f46f8.ce38c8","name":"","func":"msg.payload = msg.payload.code;\nreturn msg;","outputs":1,"noerr":0,"x":871.5,"y":177,"wires":[["b9749575.d04238"]]},{"id":"ee20c089.a9b3b","type":"openhab2-out","z":"840f46f8.ce38c8","name":"","controller":"e3ae80.b3c1018","itemname":"runBackupOutputLstExec","topic":"ItemUpdate","payload":"","x":1109,"y":101,"wires":[[]]},{"id":"f8c7a781.0a2b88","type":"openhab2-out","z":"840f46f8.ce38c8","name":"","controller":"e3ae80.b3c1018","itemname":"runBackupOutputStatus","topic":"ItemCommand","payload":"ON","x":462,"y":54,"wires":[[]]},{"id":"ba0dab80.458cd8","type":"openhab2-out","z":"840f46f8.ce38c8","name":"","controller":"e3ae80.b3c1018","itemname":"runBackupOutputStatus","topic":"ItemCommand","payload":"OFF","x":1112,"y":47,"wires":[[]]},{"id":"544e5475.653dec","type":"function","z":"840f46f8.ce38c8","name":"Check Command","func":"if(msg.payload == \"ON\")\n return [msg,null];\nelse\n return [null,msg]","outputs":2,"noerr":0,"x":211,"y":168,"wires":[["c987f084.d5b"],[]]},{"id":"eb80b45a.926ae8","type":"function","z":"840f46f8.ce38c8","name":"","func":"msg.payload = new Date();\nreturn msg;","outputs":1,"noerr":0,"x":867,"y":133,"wires":[["ee20c089.a9b3b"]]},{"id":"ca5abdd1.3ac74","type":"telegrambot-notify","z":"840f46f8.ce38c8","name":"Message","bot":"de1f1c16.74859","chatId":"-438232732","message":"Home OpenHAB server backed Up !!","parseMode":"","x":1115,"y":298,"wires":[]},{"id":"e3ae80.b3c1018","type":"openhab2-controller","z":"","name":"OpenHAB Server","protocol":"http","host":"localhost","port":"8080","path":"","username":"","password":""},{"id":"de1f1c16.74859","type":"telegrambot-config","z":"","botname":"ALBERTO (Node_RED)","usernames":"ALBERTO (Node_RED)","chatIds":"","pollInterval":"300"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.