Delete all files with same extension using executeCommandLine()

Hello all,

I’m no Linux-expert. Most probably this is the reason I’d need to post the question below.

I’m using several scripts which takes .jpg-snapshots from my camera’s and stores them on /etc/openhab2/html/

The particular folder keeps growing and growing. Every now-and-then I need to clean clean the folder manually because I’d never got the next thing working;

Above the lines which saves the snapshots, I’d put the next line of code:

executeCommandLine(“rm /etc/openhab2/html/*.jpg”)

In my opinion it should delete all .jpg-files on /etc/openhab2/html/ but it doesn’t.

The permissions seems to be OK in my opinion:

Does anybody have an idea what I’m doing wrong?

Is there any error message in the openhab.log logfile ?
I would suggest to either
a) add a waiting time parameter to the command as second parameter ( as it seems you are on OH2; otherwise it needs to be added as first parameter )
or
b) prepare a script that contains your command to be executed; call this script instead of your command as it could be that wildcard may not work ( but that is just a guess without knowing if there is an error message or not )