I had installed a Reolink video doorbell a few weeks ago, and I was a bit tired of cleaning up the files and folders with recorded video footage.
Of course I could have created a cron job to do this, but where is the fun that way... I want to show everything that is going on on my machine visually in Node-RED.
Did some testing and looks to work fine. But unfortunately I have still very limited spare time, and I don't want people to loose important documents because me having some bug in my node...
Therefore I would really appreciate if somebody could do some more testing, also for edge cases like when properties are not filled in and so on. The safest way to do such tests is with dry-run option active.
This node is currently not yet available on npm, so it need to be installed within the .node-red folder:
Hi @zenofmud,
thanks a lot for testing!
You guys in the US have other food habbits compared to me, while having a look at the file names of your pictures in your folders
That should be ok. If you have unselected the "Remove empty subfolders" option, then no folders will be removed. So no folder names in the report, because the report only shows the folders and files that will be removed. I have added that in bit more in detail in the docs now...
Yes you are absolutely right. The folder name filtering was very confusing and incorrect. I hope it is fixed now in the code. I have also added an example in the readme page.
Yes indeed a picture with thousands pink lines is more worth than a thousand words
That should now also be fixed in the code.
Yes that is normal because you should inject msg.payload.baseFolder instead of msg.baseFolder. Is that not clear in the docs?
Hopefully you can find somewhere some extra time to test it again. Thanks!!
Just a thought, will this plugin be able to delete files & folders that are not owned by the current user? Why asking is because in my Python scripts I use sudo for those
I also automatically schedule clean up of video captures from my cameras, they do consume a lot of space, but after 21 days so you have enough time "to act". Here is a fresh example from a week ago, unexpected visitor seemed interested in our cars
in the HELP for the node I'd suggest for Filename you use the full description from the GitHub description: Files with a name matching this regex pattern will be removed. Use `.*` for all files. Multiple regex patterns can be entered `;` separated, for example `.*mp4;.*jpg` to remove only files with extension "mp4" or "jpg". The value from the config screen can be overwritten via `payload.fileNamePatterns` in the input message.
(side note: using payload.fileNamePatterns will not work because the code looks for payload.fileNamePattern note the missing 's'
For Foldername I would use: Folders with a (full path folder) name matching this regex pattern will be removed. Use .* for all folders. Multiple regex patterns can be entered following the example shown in Filename. The value from the config screen can be overwritten via payload.folderNamePatterns in the input message.
You will need to change payload.folderNamePatterns in the code or documentation so they match.
Can't really tell from the pic. Could just be a bag on a neck strap.
I agree with that. I use the fast-glob module to get good support. It also includes regex matches so you don't need lots of code to support both. There are examples in the uib-file-list node in uibuilder.