dressie wrote: ↑Friday 24 April 2020 15:14
I got it to work!
I changed the following:
-moved the log file location from "/tmp" to "/var/log" (changed this in the /etc/init.d/domoticz.sh file)
Good luck, I hope this will work for you too!
P.S. this worked without the line in crontab -e.
Unfortunately no luck so far. I didn't have the delaycompress (I had it surpressed), so I added it again. Also the postrotate and endscript were surpressed, which should only be better, but in any case... I also found an empty extra line under the accolade, so I removed that as well. Let's see what happens.
BTW, you mention the file name as /etc/init.d/domoticz.sh for me it is both in another folder and doesn't have the .sh extension to it: /etc/logrotate.d/domoticz
The file you mention is to setup the logfile and it's location, it is not about rotation of the log
Well, although expected, I am a little bit disappointed today that the logrotate didn't run again last night. I still have the cron job as well, so there were 2 chances to run properly, but it didn't.
jake wrote: ↑Saturday 25 April 2020 21:19
Unfortunately no luck so far. I didn't have the delaycompress (I had it surpressed), so I added it again. Also the postrotate and endscript were surpressed, which should only be better, but in any case... I also found an empty extra line under the accolade, so I removed that as well. Let's see what happens.
BTW, you mention the file name as /etc/init.d/domoticz.sh for me it is both in another folder and doesn't have the .sh extension to it: /etc/logrotate.d/domoticz
The file you mention is to setup the logfile and it's location, it is not about rotation of the log
I ment that I changed the direction where Domoticz write it's log file in the domoticz.sh file. By default it writes to /tmp/~.
Sorry to hear it doesn't work for you, I had the same but after moving the log dir to /var/log and changing the domoticz logrotation file it started to work.
jake wrote:I copied the actual log file to /var/log as an experiment and updated the log definition. Let's see what happens tonight.
Wouldn't you believe it? My copied log in /var/log rotated fine last night. Next step is to find out what is the difference. It must be access rights to the folder.
jake wrote:I copied the actual log file to /var/log as an experiment and updated the log definition. Let's see what happens tonight.
Wouldn't you believe it? My copied log in /var/log rotated fine last night. Next step is to find out what is the difference. It must be access rights to the folder.
Nice! I think it has got to do with the location of the log file. It's common to have it in the "/var/log ". Perhaps logrotation is very particular about that.
jake wrote:I copied the actual log file to /var/log as an experiment and updated the log definition. Let's see what happens tonight.
Wouldn't you believe it? My copied log in /var/log rotated fine last night. Next step is to find out what is the difference. It must be access rights to the folder.
Nice! I think it has got to do with the location of the log file. It's common to have it in the "/var/log ". Perhaps logrotation is very particular about that.
Well, until Buster it has always worked and doing the command manually it also works, so somehow during the automatic execution it goes wrong.
The /tmp folder runs in a ram disk so moving the log permanently to/var/log is no option.
My domoticz.log file reached 18GB, good performance indeed! but the 64GB drive of my rpi is now full.
I would like to shrink it proceeding to a rotating log file over time week, month, year, tbd.
I don't need any ram drive as I'm using a SSD on a raspberry pi.
I'm a linux dummy, so I then request help.
Thanks
Patricen wrote: ↑Friday 28 June 2024 9:18
Thanks!
I mentioned that this file history is useless for me, is there a parameter to limit domoticz.log size?
You can switch it off by commenting it out (#) from the /etc/init.d/domoticz.sh startup script (see wiki https://www.domoticz.com/wiki/Troublesh ... bugging.29 )
Then you only see the short log in the web interface menu Setup - Log.
This is also the default situation when installing a fresh install.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Patricen wrote: ↑Friday 28 June 2024 9:18
Thanks!
I mentioned that this file history is useless for me, is there a parameter to limit domoticz.log size?
No you did not, you asked for log rotation.
The history is the GUI is very short.
If you ever have errors, then the GUI will not help you to get those resolved, because the error remains in the GUI but the preceding logging is gone.
Logic will get you from A to B. Imagination will take you everywhere.
If you install logrotate it will run, because it installs a service and timer.
In this topic are domoticz config files for domoticz logrotate present, just copy one of those and you are good.
Read this topic from the beginning.
Logic will get you from A to B. Imagination will take you everywhere.