I've just had a look at your flow, and it seems that you've deleted some necessary code from the 'Generate commands' node which I've re-added, and the path formats were not correct.
So with the flow corrected, firstly I've added the path for a temporary directory (to hold the archive before sending it to dropbox) on line 3 of the 'Generate commands' node;
var path = '/home/pi/tempDir/';
TAKE NOTE - the trailing slash /
This can be any path on your system, and doesn't need to be created first - the flow will create it.
On my pi, I've created a folder which contains a number of files which I want to back up;
/home/pi/testDir
├── test1.txt
├── test2.txt
└── test3.txt
.and added the path /home/pi/testDir
to line 27 of the 'Generate commands' node.
Again, this can be a directory path of your choice.
Finally, I updated the 2 paths in the 'Read filenames' with the new tempDir path.
Running the flow, results in this msg being injected into the dropbox node - which is the path for the archive file to be uploaded to dropbox.
...and the Thu_testDir.tar.gz
file being successfully uploaded to Dropbox.
Anyway, here is the flow which I used in the above example;
[{"id":"1b89f49d.7bc87b","type":"comment","z":"9616f62.4426f08","name":"Nightly Backups","info":"","x":123,"y":100,"wires":[]},{"id":"2c3308c.d13c2f8","type":"inject","z":"9616f62.4426f08","name":"Start backup","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 03 * * *","once":false,"onceDelay":"","x":130,"y":150,"wires":[["51aee723.e82988"]]},{"id":"5d361489.9c825c","type":"function","z":"9616f62.4426f08","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 else {\n // otherwise we are empty so just pass through and set busy flag\n context.busy = true;\n return msg;\n }\n}\n\nreturn [null,msg2];","outputs":"2","noerr":0,"x":300,"y":240,"wires":[["683cd42.833362c"],["c6b1a676.bfd758"]]},{"id":"fb715149.0d43f","type":"function","z":"9616f62.4426f08","name":"set trigger","func":"// handle the return from the exec in here \n// if all is good then set msg.trigger property to exist\nmsg.trigger = 1;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":150,"wires":[["5d361489.9c825c"]]},{"id":"683cd42.833362c","type":"exec","z":"9616f62.4426f08","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Execute commands","x":530,"y":230,"wires":[["fb715149.0d43f"],[],["15110d05.06fe83"]]},{"id":"c6b1a676.bfd758","type":"function","z":"9616f62.4426f08","name":"Read filenames","func":"var path = ('/home/pi/tempDir/');\nvar fs = (global.get('fse'));\n\nfs.readdirSync(path).forEach(file => {\n node.send({localFilename: \"/home/pi/tempDir/\"+(file)});\n});\nreturn null;","outputs":1,"noerr":0,"x":310,"y":300,"wires":[["798ff79f.0715d8"]]},{"id":"51aee723.e82988","type":"function","z":"9616f62.4426f08","name":"Generate commands","func":"//--Edit these to your own installation\n//Don't change these!\nvar path = '/home/pi/tempDir/';\n\n//Generate days to add to archive title\nvar d = new Date();\nvar day = new Array(7);\nday[0]= \"Sun\";\nday[1] = \"Mon\";\nday[2] = \"Tue\";\nday[3] = \"Wed\";\nday[4] = \"Thu\";\nday[5] = \"Fri\";\nday[6] = \"Sat\";\n\n//Create directory structure\nvar m1={payload: \"rm -rf \"+[path]};\nvar m2={payload: \"mkdir \"+[path]};\n\n// ************************************************************************* //\n// *** The below commands will archive the entire node-red user directory,\n// *** emoncms data directories & mysql. To add further commands, use the\n// *** same format, and add the corresponding msg id to the 'return' statement.\n// ************************************************************************* //\n//---Log Filer---//\n //Create ~/testDir archive\n var m4={payload: \"tar -czvf \"+[path]+(day[d.getDay()])+\"_testDir\"+\".tar.gz /home/pi/testDir\"};\n\n// Output the commands for execution\nreturn [ [ m1, m2, m4, ] ];","outputs":"1","noerr":0,"x":334,"y":150,"wires":[["5d361489.9c825c"]]},{"id":"15110d05.06fe83","type":"function","z":"9616f62.4426f08","name":"Report any errors","func":"var code = (msg.payload.code);\nif ([code] != \"0\") {\nmsg.payload = (msg.payload.message);\nmsg.topic = \"Raspberry backup process failed\";\nreturn msg;\n}\nelse {\nreturn null;\n}","outputs":1,"noerr":0,"x":300,"y":350,"wires":[["9d4138d9.e0f328"]]},{"id":"e1e0dd4a.dc498","type":"comment","z":"9616f62.4426f08","name":"README (select & view in info panel!)","info":"**REQUIREMENTS** \nRequires the library fs-extra installing & enabling\nglobally in settngs.js \n(used in `Read Filenames` function node)\n\nTO INSTALL FS-EXTRA \n```\ncd ./node-red \nnpm install --save fs-extra\n```\nTO MAKE FS-EXTRA GLOBAL \nAdd `fse:require('fs-extra')` to the\n`functionGlobalContext` section in NR settings.js file.\n\n**CONFIGURATION** \nEdit the `Generate commands` function node with \nyour own; \n- Emoncms data directory path\n- Emoncms MYSQL username (default = emoncms)\n- Emoncms MYSQL password \n\nSetup the `dropbox` node, (details in the node info) \nAlso edit the `Start backup` inject node with your preferred time to run. \nIf you want to be alerted about archive problems or failures, you can use the `Report any errors` node output to dispatch the message via Pushover, email, twitter or whatever.","x":379,"y":99,"wires":[]},{"id":"9d4138d9.e0f328","type":"debug","z":"9616f62.4426f08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":600,"y":350,"wires":[]},{"id":"798ff79f.0715d8","type":"debug","z":"9616f62.4426f08","name":"Replace with dropbox node","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":600,"y":300,"wires":[]}]