Hi Forum,
I wanted to copy file from windows shared folder to a linux path//folder using Node-Red. Can anyone share your suggestions on how to implement this?
Hi Josh!
I think you can use the exec node, where you can use bash (terminal) commands to copy a selected file everywhere you like.
Be carefoul about what you are moving
You can find plenty of tutorials about copying files from linux/windows terminal.
Stay safe!
Riccardo
Thanks Riccardo, Can you provide me with an example. Newbie here
What command do you need to execute? If you don't know that (which is not a node-red issue) then have you looked for tutorials as suggested?
Sure
[{"id":"c5c816893926435f","type":"exec","z":"3d4bf0146e729959","command":"","addpay":"payload","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":810,"y":400,"wires":[[],[],[]]},{"id":"d3f78eb5b09bbaca","type":"inject","z":"3d4bf0146e729959","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":400,"wires":[["17620898bcfa7fe7"]]},{"id":"17620898bcfa7fe7","type":"function","z":"3d4bf0146e729959","name":"command with file locations","func":"msg.payload = \"cp [...file/directory-sources] [destination]\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":400,"wires":[["c5c816893926435f"]]}]
With that example you can specify the path of file source and destination in the function node after the 'cp' that means copy, in msg.payload. The payload will be executed by the exec node.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.