I had an idea to have a simple rule, which can restart Openhab service and can restart + delete all logs in openhab folder, so I wrote:
Item Restart_Logs changed from OFF to ON
executeCommandLine(‘sudo /bin/rm /var/log/openhab/*’)
executeCommandLine(‘sudo service openhab restart’)
I have similar function just to restart process and it works well. Problem is with rm. When I put it in shell "sudo /bin/rm /var/log/openhab/* all logs were deleted. Also I notices when I put exect file name which I want to remove, ie.
executeCommandLine(‘sudo /bin/rm /var/log/openhab/satel.log’)
it also works.
So probably there is a problem with *, so is it any other way to refer to all files and let Openhab execute it ?
I have also no problems with persmissions.