problem changing linux file-permissions
Posted: Wednesday 08 March 2023 11:32
I am struggling to hav a file "pi" permission i.s.o. root.
The aim is to create a textfile holding values of gasmeter. At regular times I want to inspect the content of the file (gas.txt).
But although I used the command : 'sudo chmod 777 ' .. 'gas.txt' it still only has root permissions.
The script is OK but not for changing permissions. What to do?
Bart
The aim is to create a textfile holding values of gasmeter. At regular times I want to inspect the content of the file (gas.txt).
But although I used the command : 'sudo chmod 777 ' .. 'gas.txt' it still only has root permissions.
The script is OK but not for changing permissions. What to do?
Code: Select all
return {
on = {
devices = {
913, --switch to force the script to run for testpurpose
},
timer = {
'at 07:00',
'at 19:00',
}
},
logging = {
level = domoticz.LOG_INFO,
marker = 'BSOtest',
},
execute = function(dz, timer)
local gasstand = dz.devices(762).counter -- 762 is IDX gasmeter
local datetimestamp = tostring(os.date('%Y-%m-%d %H:%M:%S'))
file = io.open("/home/pi/gas.txt", "a+")
dz.utils.osCommand('sudo chmod 777 ' .. 'gas.txt')
file:write(datetimestamp.." gasstand "..gasstand.."\n")
file:close()
end
}