Here is the flow - let me know if you have any questions. Also, if you see any “private” information (not sure if the Pushover keys come across in the subflow), please PM me.
Flow
[{“id”:“43d0561c.bc9a8”,“type”:“group”,“z”:“934f1005.6e02”,“style”:{“stroke”:"#999999",“stroke-opacity”:“1”,“fill”:“none”,“fill-opacity”:“1”,“label”:true,“label-position”:“nw”,“color”:"#a4a4a4"},“nodes”:[“cd22e7e2.888bc8”,“8226bc6e.3f3bf”],“x”:44.33331298828125,“y”:1217.33349609375,“w”:1826.3333435058594,“h”:633.333251953125},{“id”:“cd22e7e2.888bc8”,“type”:“group”,“z”:“934f1005.6e02”,“g”:“43d0561c.bc9a8”,“style”:{“stroke”:"#999999",“stroke-opacity”:“1”,“fill”:“none”,“fill-opacity”:“1”,“label”:true,“label-position”:“nw”,“color”:"#a4a4a4"},“nodes”:[“404df91e.678728”,“4a36ae5e.fc2f6”,“e2926be.1db6c18”,“143a6921.4cb1ff”,“679f4c40.e152f4”,“e393a496.bc42a”,“8e104641.0b73f8”,“3f18280b.ffe37”,“3c8c6582.074e2a”,“1376d789.9b6be8”,“77656b03.8d502c”,“30aea08d.93dfa”,“3ad73356.874114”,“b5fc34cc.6c5b88”,“2ef6ee6d.09c662”,“7968c111.14d96”,“7fcfef26.cef7b8”,“7c29ec5d.40d38c”],“x”:75.66665649414062,“y”:1243.33349609375,“w”:1769,“h”:410.66650390625},{“id”:“34d03f0e.2cfc6”,“type”:“subflow”,“name”:“Notification Handler”,“info”:"",“category”:"",“in”:[{“x”:60,“y”:80,“wires”:[{“id”:“e450ca50.a95f18”}]}],“out”:[],“env”:[],“color”:"#DDAA99"},{“id”:“d61bf195.44c66”,“type”:“comment”,“z”:“34d03f0e.2cfc6”,“name”:“Notification Subflow”,“info”:"",“x”:130,“y”:20,“wires”:[]},{“id”:“e450ca50.a95f18”,“type”:“pushover”,“z”:“34d03f0e.2cfc6”,“name”:“Send Notification”,“device”:"",“title”:"",“priority”:0,“sound”:"",“url”:"",“url_title”:"",“html”:false,“x”:210,“y”:80,“wires”:[]},{“id”:“404df91e.678728”,“type”:“inject”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“1:15 AM Saturday”,“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:"",“crontab”:“15 01 * * 6”,“once”:false,“onceDelay”:0.1,“topic”:"",“payload”:"",“payloadType”:“date”,“x”:221.66665649414062,“y”:1350,“wires”:[[“4a36ae5e.fc2f6”]]},{“id”:“4a36ae5e.fc2f6”,“type”:“moment”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:"",“topic”:"",“input”:"",“inputType”:“msg”,“inTz”:“America/Chicago”,“adjAmount”:0,“adjType”:“days”,“adjDir”:“add”,“format”:“YYYY-MM-DD”,“locale”:“en_US”,“output”:"",“outputType”:“msg”,“outTz”:“America/Chicago”,“x”:468.6666564941406,“y”:1350,“wires”:[[“e2926be.1db6c18”]]},{“id”:“e2926be.1db6c18”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Set File Path Parts”,“rules”:[{“t”:“set”,“p”:“filePath”,“pt”:“msg”,“to”:"/home/pi/Documents/Nodered_Backup/",“tot”:“str”},{“t”:“set”,“p”:“backupDate”,“pt”:“msg”,“to”:“payload”,“tot”:“msg”},{“t”:“set”,“p”:“fileSuffix”,“pt”:“msg”,“to”:"-Nodered_Backup.zip",“tot”:“str”},{“t”:“set”,“p”:“ftpPath”,“pt”:“msg”,“to”:"/rakesh/Home Automation Backups/Nodered Full/",“tot”:“str”},{“t”:“set”,“p”:“command”,“pt”:“msg”,“to”:“sudo zip -rq”,“tot”:“str”},{“t”:“set”,“p”:“pathToNodered”,“pt”:“msg”,“to”:"/home/pi/.node-red",“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:702.6666259765625,“y”:1350,“wires”:[[“143a6921.4cb1ff”]]},{“id”:“143a6921.4cb1ff”,“type”:“function”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Set Full File Path”,“func”:"//Set File path+name for local backup\nmsg.localFilename = msg.filePath+msg.backupDate+msg.fileSuffix;\n\n// Set FTP path+name for backup to NAS\nmsg.ftpFilename = msg.ftpPath+msg.backupDate+msg.fileSuffix;\n\n// Command to Zip Nodered install for Exec Node\nmsg.payload = msg.command+" “+msg.localFilename+” “+msg.pathToNodered\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:"",“finalize”:"",“x”:937.6666564941406,“y”:1350,“wires”:[[“679f4c40.e152f4”]]},{“id”:“679f4c40.e152f4”,“type”:“exec”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“command”:"",“addpay”:true,“append”:"",“useSpawn”:“false”,“timer”:"",“oldrc”:false,“name”:“Backup Nodered”,“x”:1182.6665344238281,“y”:1350,“wires”:[[“e393a496.bc42a”],[“e393a496.bc42a”],[“e393a496.bc42a”,“8e104641.0b73f8”]]},{“id”:“e393a496.bc42a”,“type”:“debug”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Exec Output”,“active”:false,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“statusVal”:"",“statusType”:“auto”,“x”:1444.6665344238281,“y”:1351,“wires”:[]},{“id”:“8e104641.0b73f8”,“type”:“switch”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Zip Success?”,“property”:“payload.code”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“0”,“vt”:“str”},{“t”:“else”}],“checkall”:“false”,“repair”:false,“outputs”:2,“x”:231.66659545898438,“y”:1441,“wires”:[[“3f18280b.ffe37”],[“3c8c6582.074e2a”]]},{“id”:“3f18280b.ffe37”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Set FTP File Paths”,“rules”:[{“t”:“set”,“p”:“filename”,“pt”:“msg”,“to”:“ftpFilename”,“tot”:“msg”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:503.66668701171875,“y”:1435,“wires”:[[“1376d789.9b6be8”]]},{“id”:“3c8c6582.074e2a”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Zip Failed”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:“Unable to zip Node-RED”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:421.6666259765625,“y”:1613,“wires”:[[“77656b03.8d502c”]]},{“id”:“1376d789.9b6be8”,“type”:“ftp in”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“ftp”:“3164f7d8.d5f6c8”,“operation”:“put”,“filename”:"",“localFilename”:"",“name”:“FTP to Backup to NAS”,“x”:738.6666564941406,“y”:1435,“wires”:[[“30aea08d.93dfa”]]},{“id”:“77656b03.8d502c”,“type”:“function”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Set Notification Params”,“func”:"//Set error message\n\nvar message = msg.payload;\nvar topic = “Nodred backup - “+msg.backupDate;\nvar priority = 0; //values are -2,-1,0,1,2\nvar device = “”; //Blank device = All\nvar url = “”; // url to be included in message\nvar url_title = “”;// title of URL\nvar sound = “”; // notifcation sound\nvar attachmentPath = “”; //file path if attachment is included\n\n//Inputs for Notification Subflow\nmsg.payload = message;\nmsg.topic = topic;\nmsg.device = device;\nmsg.priority = priority;\nmsg.url = url;\nmsg.url_title = url_title\nmsg.attachment = attachmentPath;\nmsg.sound = sound;\n\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:”",“finalize”:"",“x”:1466.6666564941406,“y”:1610.3336181640625,“wires”:[[“3ad73356.874114”]]},{“id”:“30aea08d.93dfa”,“type”:“switch”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“FTP Success?”,“property”:“payload”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“Put operation successful.”,“vt”:“str”},{“t”:“else”}],“checkall”:“false”,“repair”:false,“outputs”:2,“x”:984.6666564941406,“y”:1435,“wires”:[[“7968c111.14d96”],[“2ef6ee6d.09c662”]]},{“id”:“3ad73356.874114”,“type”:“subflow:34d03f0e.2cfc6”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:"",“env”:[],“x”:1718.6666564941406,“y”:1611.3336181640625,“wires”:[]},{“id”:“b5fc34cc.6c5b88”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Backup Success”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:“Nodred Backup Successful”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1242.6665954589844,“y”:1510,“wires”:[[“77656b03.8d502c”]]},{“id”:“2ef6ee6d.09c662”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Backup Failed”,“rules”:[{“t”:“set”,“p”:“payload”,“pt”:“msg”,“to”:“Nodered Backup Failed”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1177.6666564941406,“y”:1566,“wires”:[[“77656b03.8d502c”]]},{“id”:“7968c111.14d96”,“type”:“change”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Set Local File Path”,“rules”:[{“t”:“set”,“p”:“filename”,“pt”:“msg”,“to”:“localFilename”,“tot”:“msg”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1193.6666564941406,“y”:1429,“wires”:[[“7fcfef26.cef7b8”]]},{“id”:“7fcfef26.cef7b8”,“type”:“file”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Delete Local Backup”,“filename”:"",“appendNewline”:true,“createDir”:false,“overwriteFile”:“delete”,“encoding”:“none”,“x”:1418.6665954589844,“y”:1429,“wires”:[[“b5fc34cc.6c5b88”]]},{“id”:“7c29ec5d.40d38c”,“type”:“comment”,“z”:“934f1005.6e02”,“g”:“cd22e7e2.888bc8”,“name”:“Backup Nodered and FTP”,“info”:"",“x”:240.33331298828125,“y”:1284.33349609375,“wires”:[]},{“id”:“3164f7d8.d5f6c8”,“type”:“ftp”,“host”:“192.168.1.110”,“port”:"",“secureOptions”:"",“user”:“rakesh”,“connTimeout”:"",“pasvTimeout”:"",“keepalive”:""},{“id”:“8226bc6e.3f3bf”,“type”:“group”,“z”:“934f1005.6e02”,“g”:“43d0561c.bc9a8”,“style”:{“stroke”:"#999999",“stroke-opacity”:“1”,“fill”:“none”,“fill-opacity”:“1”,“label”:true,“label-position”:“nw”,“color”:"#a4a4a4"},“nodes”:[“3890a76a.1c524”,“e195b311.83ac2”,“2e52854a.7120aa”,“d58d04f0.8d7948”],“x”:70.33331298828125,“y”:1689.666748046875,“w”:782,“h”:135},{“id”:“3890a76a.1c524”,“type”:“catch”,“z”:“934f1005.6e02”,“g”:“8226bc6e.3f3bf”,“name”:“Download Backup Error”,“scope”:[“404df91e.678728”,“4a36ae5e.fc2f6”,“e2926be.1db6c18”,“143a6921.4cb1ff”,“679f4c40.e152f4”,“8e104641.0b73f8”,“3c8c6582.074e2a”,“3f18280b.ffe37”,“1376d789.9b6be8”,“30aea08d.93dfa”,“7968c111.14d96”,“7fcfef26.cef7b8”,“b5fc34cc.6c5b88”,“2ef6ee6d.09c662”,“77656b03.8d502c”,“3ad73356.874114”],“uncaught”:false,“x”:206.33331298828125,“y”:1783.666748046875,“wires”:[[“e195b311.83ac2”]]},{“id”:“e195b311.83ac2”,“type”:“function”,“z”:“934f1005.6e02”,“g”:“8226bc6e.3f3bf”,“name”:“Set Error Notification Params”,“func”:"//Set error message\n\nvar message = “An error occurred at Name: “+msg.error.source.name+ “, Node Type: “+msg.error.source.type +” , Message: “+msg.error.message\nvar topic = “Nodered backup exception”\nvar priority = 0 //values are -2,-1,0,1,2\nvar device = “” //Blank device = All\nvar url = “” // url to be included in message\nvar url_title = “” // title of URL\nvar sound = “” // notifcation sound\nvar attachmentPath = “” //file path if attachment is included\n\n//Inputs for Notification Subflow\nmsg.payload = message;\nmsg.topic = topic;\nmsg.device = device;\nmsg.priority = priority;\nmsg.url = url;\nmsg.url_title = url_title\nmsg.attachment = attachmentPath;\nmsg.sound = sound;\n\nreturn msg;”,“outputs”:1,“noerr”:0,“initialize”:””,“finalize”:”",“x”:466.33331298828125,“y”:1783.666748046875,“wires”:[[“2e52854a.7120aa”]]},{“id”:“2e52854a.7120aa”,“type”:“subflow:34d03f0e.2cfc6”,“z”:“934f1005.6e02”,“g”:“8226bc6e.3f3bf”,“name”:"",“env”:[],“x”:726.3333129882812,“y”:1783.666748046875,“wires”:[]},{“id”:“d58d04f0.8d7948”,“type”:“comment”,“z”:“934f1005.6e02”,“g”:“8226bc6e.3f3bf”,“name”:“Exception Handing - Nodered Backup”,“info”:"",“x”:246.33331298828125,“y”:1730.666748046875,“wires”:[]}]