Hello
I willed create an automatism deleted folder if folder is to old. I have a varible in global with :
-patch folder : /home/pi/Documents/ANPR/IMAGES/2023
-nbr_day : 60
If inject with node inject this command this is ok
find /home/pi/Documents/ANPR/IMAGES/2023 -mtime +60 -exec rm -r {} ;
I willed execute this fonction with an logic beacause 2023 and 60 are variable but I have one error node function.
[{"id":"12331c71.416324","type":"inject","z":"a8416f68.4598b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":1980,"wires":[["bd2836fd.965718"]]},{"id":"bc3aa9e3.1545e8","type":"debug","z":"a8416f68.4598b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":980,"y":1980,"wires":[]},{"id":"bd2836fd.965718","type":"change","z":"a8416f68.4598b","name":"","rules":[{"t":"set","p":"folder","pt":"msg","to":"filebrowser_default_folder_IMAGES","tot":"global"},{"t":"set","p":"TimeImage","pt":"msg","to":"backimage","tot":"global"},{"t":"set","p":"Year","pt":"msg","to":"Years","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":1980,"wires":[["9b751a56.c5db68"]]},{"id":"9b751a56.c5db68","type":"function","z":"a8416f68.4598b","name":"","func":"msg.payload =\"find \"&msg.folder& \"/\"&msg.Year &\" -mtime +\"&msg.TimeImage &\" -exec rm {} \\;'\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":1980,"wires":[["bc3aa9e3.1545e8"]]}]
The result is : {"_msgid":"c550bbd2.c1c7b8","payload":0,"folder":"/home/pi/Documents/ANPR/IMAGES","TimeImage":15,"Year":"2023"}
with payload : 0 different to find /home/pi/Documents/ANPR/IMAGES/2023 -mtime +60 -exec rm -r {} ;
Wher is my problem or error ?
Thank you for your help