Skip to content

Instantly share code, notes, and snippets.

@Paul-Reed
Paul-Reed / Node-red archive to dropbox flow
Last active April 24, 2022 12:55
A node-red flow which runs an archive routine, uploading data to Dropbox for safe keeping!
[{"id":"3857b636.3f0c9a","type":"comment","z":"4487e413.bb781c","name":"Nightly Backups","info":"","x":144,"y":1212,"wires":[]},{"id":"d7570d3d.383af","type":"inject","z":"4487e413.bb781c","name":"Start backup","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 03 * * *","once":false,"x":151,"y":1262,"wires":[["d3620081.6ce2a"]]},{"id":"86146d4a.44769","type":"function","z":"4487e413.bb781c","name":"Triggered queue","func":"// if queue doesn't exist, create it\ncontext.queue = context.queue || [];\ncontext.busy = context.busy || false;\n\n// if the msg is a trigger one release next message\nif (msg.hasOwnProperty(\"trigger\")) {\n if (context.queue.length > 0) {\n var m = context.queue.shift();\n return {payload:m};\n }\n else {\n context.busy = false;\n // node.send({payload:\"result\"});\n var msg2 = { payload:\"OK\" };\n }\n}\nelse {\n if (context.busy) {\n // if busy add to queue\n context.queue.push(msg.payload);\n }\n

Keybase proof

I hereby claim:

  • I am Paul-Reed on github.
  • I am pauldreed (https://keybase.io/pauldreed) on keybase.
  • I have a public key whose fingerprint is 169F 5CA4 5D60 CD76 19EC 3DF6 A632 6B72 3659 BCA0

To claim this, I am signing this object: