The flow is simple as hell:
[
{
"id": "a03ab777.710698",
"type": "debug",
"z": "f92c309a.afade",
"name": "hook",
"active": false,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 930,
"y": 620,
"wires": []
},
{
"id": "271f9e23.20b8d2",
"type": "exec",
"z": "f92c309a.afade",
"command": "",
"addpay": true,
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "",
"x": 710,
"y": 720,
"wires": [
[],
[],
[]
]
},
{
"id": "9eeb7fdc.b058e",
"type": "function",
"z": "f92c309a.afade",
"name": "build cmd",
"func": "const file = msg.file\nconst share = '/config/samba/camera'\nconst d = new Date()\nmsg.payload = `cp ${file} ${share}/${Date.now()}.jpg`\nreturn msg",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 720,
"y": 680,
"wires": [
[
"271f9e23.20b8d2",
"efc2f381.93dd3"
]
]
},
{
"id": "efc2f381.93dd3",
"type": "debug",
"z": "f92c309a.afade",
"name": "exec",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 720,
"wires": []
}
]