Keeping my own Log file

I added a scene that is executed each end of day to keep my own log history for at least one month…(all my logs are tagged starting with “Ray:”)

Here is the lua script

--------------------------------------------------------
-- Remove the log file once a month 
--------------------------------------------------------
local currentDay = os.date("%d")
if tonumber(currentDay) == 1 then
    os.execute("rm /etc/cmh-ludl/00-LuaRay.log")
    os.execute("sleep 1")
end
os.execute("grep Ray: /tmp/log/cmh/LuaUPnP.log >> /etc/cmh-ludl/00-LuaRay.log")

However, the file is displayed in the “Luup Files” web page, but nothing appear when I click on the corresponding “view” option. The content is OK because I can see it with an SSH session with the “cat” function. How can I correct the situation to also view it thru the web page ?

Hello Raynald,

Thank you for bringing this to our attention. If that’s not working you can output the result of your grep search to /www/LuaRay.txt and then open a data request, erase from port and write /LuaRay.txt like so

https://vera-us-oem-relayXX.mios.com/relay/relay/relay/device/XXXXXXXXX/session/XXXXXXXXX/LuaRay.txt

@Thiago Sorry but it’s not very clear how to access the file thru the URL…

How should I substitute the relayXX / XXXXXXXXX in the URL ?

I found the solution…

local currentDay = os.date("%d")
if tonumber(currentDay) == 1 then
    os.execute("rm /tmp/log/cmh/00-LuaRay.log")
end
os.execute("grep Ray: /tmp/log/cmh/LuaUPnP.log >> /tmp/log/cmh/00-LuaRay.log")
os.execute("pluto-lzo c /tmp/log/cmh/00-LuaRay.log /etc/cmh-ludl/00-LuaRay.log.lzo")