Using hassio 0.103.4. Whenever i restart Home Assistant from Configuration-Server Control-Server Management-Restart button, HA purges the home-assistant.log file and create a new one from scratch. I would like to examine the previous log file for problems; is there a way to back-up/rename home-assistant.log file automatically whenever i restart HA??
Well the logic is completely right, however on shell command i am stuck with hassio not letting using folder or file. Both ‘/home-assistant.log’ and ‘/usr/share/hassio/homeassistant//home-assistant.log’ is giving error; maybe from the file priviliges. As i see lots of people are having the same problem. Thanks anyway…
which works like a charm! Now i need to find a way to rename backup log files which is busybox compliant…
Thanks for all your help.
UPDATE:
Solved also the version renaming issue. For future reference, here they are:
shell_command:
# Backup logs and append a version number if one already exists.
backup_logs: cp /config/home-assistant.log /config/external_data/log-`date +"%Y%m%d%H%M"`.log