I am getting somewhere, but not there yet.
So made the error message when doing a config check go away by using my own defined text “system_log”.
Restarted Hassio (0.71) but no “Clear Log HA” appeard in my system. And I am not getting button “Activate”?
Do I have to bind the script/shell comands to a switch.And if so, please give an example of the code?
Your shell commands does delete and creates a new file. But HA (Hassio 0.71.0) cannot write log entries into the new file. The log file stays empty after activating the script. Have monitored it for days. And the log files are still empty.
Just for full understanding, the truncate command makes the shell_commands create_log and set_perm
obsolete. Truncate keeps the file in tact and deletes the contents of the logfile.
If you’d like to clear the log just create a script called empty_log in the scripts.yaml file. The script calls the shell command. I have commented out the shell commands that are not needed if you use the truncate command:
No idea how the purging actually works. Might need a restart to purge the db.
The suggestion of mine has nothing to do with the log, so it’s not helpful at all.
No idea why I posted that
Using the same logic in script, actually I managed to clear the database by deleting it using this command written in “clear_db.yaml” in the “shell” folder. rm home-assistant_v2.db
It deletes the DB but for unknown reason HA recreates one back but no more than 4k in size and the log is pouring with errors because cannot write in the db any more.
A reboot fixes this and deleting the 4k db file.
I wonder id truncate command works on db file, since is not a text file like the log.
ps.
It is safe to delete db file while HA is On, it will recreate another fresh one.