Temp-Logfile 14 MB! Wie leeren?

Begonnen von Esteban, 03 Mai 2016, 10:54:36

Vorheriges Thema - Nächstes Thema

Esteban

Hi!

Ich hab seit Anfang April einen JeeLink und einen LaCrosse Temp-Sensor angeschlossen. Momentan teste ich eigentlich nur aber die ganze Sache wurde immer langsamer. Eben hab ich gesehen, dass das Logfile "TempBalkon-2016.log" über 14 MB hat und sich anscheinend nicht leert bzw. nur jährlich wechselt. Nun sind die Temp-Daten für mich persönlich nach einer Woche eher uninteressant, eigentlich können sie auch komplett weg.

Wie kann ich mit FHEM Bordmitteln oder von mir aus auch unter Linux ein Logfile leeren, ohne es zu löschen? Wahrscheinlich kann ich nicht angeben, dass nur Text vor Zeitpunkt X wegkommt, oder?

Ist das eigentlich normal, dass sich der Temp-Sensor recht unregelmäßig meldet? Hier mal ein Auszug:

2016-05-03_10:42:53 TempBalkon T: 10.8 H: 74
2016-05-03_10:42:58 TempBalkon battery: ok
2016-05-03_10:42:58 TempBalkon temperature: 10.8
2016-05-03_10:42:58 TempBalkon humidity: 74
2016-05-03_10:43:09 TempBalkon battery: ok
2016-05-03_10:43:09 TempBalkon temperature: 10.8
2016-05-03_10:43:09 TempBalkon humidity: 74
2016-05-03_10:43:09 TempBalkon battery: ok
2016-05-03_10:43:09 TempBalkon temperature: 10.8
2016-05-03_10:43:09 TempBalkon humidity: 75
2016-05-03_10:43:09 TempBalkon T: 10.8 H: 75
2016-05-03_10:43:43 TempBalkon battery: ok
2016-05-03_10:43:43 TempBalkon temperature: 10.8
2016-05-03_10:43:43 TempBalkon humidity: 74
2016-05-03_10:43:43 TempBalkon T: 10.8 H: 74
2016-05-03_10:43:48 TempBalkon battery: ok
2016-05-03_10:43:48 TempBalkon temperature: 10.8
2016-05-03_10:43:48 TempBalkon humidity: 75
2016-05-03_10:43:48 TempBalkon T: 10.8 H: 75
2016-05-03_10:43:53 TempBalkon battery: ok
2016-05-03_10:43:53 TempBalkon temperature: 10.8
2016-05-03_10:43:53 TempBalkon humidity: 75
2016-05-03_10:43:58 TempBalkon battery: ok
2016-05-03_10:43:58 TempBalkon temperature: 10.8
2016-05-03_10:43:58 TempBalkon humidity: 75
2016-05-03_10:44:13 TempBalkon battery: ok
2016-05-03_10:44:13 TempBalkon temperature: 10.8
2016-05-03_10:44:13 TempBalkon humidity: 75
2016-05-03_10:44:48 TempBalkon battery: ok
2016-05-03_10:44:48 TempBalkon temperature: 10.8
2016-05-03_10:44:48 TempBalkon humidity: 75
2016-05-03_10:44:58 TempBalkon battery: ok
2016-05-03_10:44:58 TempBalkon temperature: 10.8
2016-05-03_10:44:58 TempBalkon humidity: 75
2016-05-03_10:45:08 TempBalkon battery: ok
2016-05-03_10:45:08 TempBalkon temperature: 10.8
2016-05-03_10:45:08 TempBalkon humidity: 75
2016-05-03_10:45:43 TempBalkon battery: ok
2016-05-03_10:45:43 TempBalkon temperature: 10.7
2016-05-03_10:45:43 TempBalkon humidity: 75
2016-05-03_10:45:43 TempBalkon T: 10.7 H: 75
2016-05-03_10:45:48 TempBalkon battery: ok
2016-05-03_10:45:48 TempBalkon temperature: 10.8
2016-05-03_10:45:48 TempBalkon humidity: 75
2016-05-03_10:45:48 TempBalkon T: 10.8 H: 75
2016-05-03_10:45:53 TempBalkon battery: ok
2016-05-03_10:45:53 TempBalkon temperature: 10.8
2016-05-03_10:45:53 TempBalkon humidity: 75
2016-05-03_10:46:01 TempBalkon battery: ok
2016-05-03_10:46:01 TempBalkon temperature: 10.8
2016-05-03_10:46:01 TempBalkon humidity: 75
2016-05-03_10:46:08 TempBalkon battery: ok
2016-05-03_10:46:08 TempBalkon temperature: 10.8
2016-05-03_10:46:08 TempBalkon humidity: 75
2016-05-03_10:46:43 TempBalkon battery: ok
2016-05-03_10:46:43 TempBalkon temperature: 10.8
2016-05-03_10:46:43 TempBalkon humidity: 75
2016-05-03_10:46:48 TempBalkon battery: ok
2016-05-03_10:46:48 TempBalkon temperature: 10.7
2016-05-03_10:46:48 TempBalkon humidity: 75
2016-05-03_10:46:48 TempBalkon T: 10.7 H: 75
2016-05-03_10:46:53 TempBalkon battery: ok
2016-05-03_10:46:53 TempBalkon temperature: 10.7
2016-05-03_10:46:53 TempBalkon humidity: 75
2016-05-03_10:46:58 TempBalkon battery: ok
2016-05-03_10:46:58 TempBalkon temperature: 10.7
2016-05-03_10:46:58 TempBalkon humidity: 75
2016-05-03_10:47:03 TempBalkon battery: ok
2016-05-03_10:47:03 TempBalkon temperature: 10.8
2016-05-03_10:47:03 TempBalkon humidity: 75
2016-05-03_10:47:03 TempBalkon T: 10.8 H: 75
2016-05-03_10:47:08 TempBalkon battery: ok
2016-05-03_10:47:08 TempBalkon temperature: 10.7
2016-05-03_10:47:08 TempBalkon humidity: 75
2016-05-03_10:47:08 TempBalkon T: 10.7 H: 75

FHEM v5.9 auf RPi 3B+ Raspbian Stretch | Busware CUL 433 MHz | 20x IT-1500 | HMUSB2 mit diversen HM Komponenten

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

ernst1024

einfach löschen, fhem legt es nach einem Neustart wieder an.
Gruß Ernst

Mitch

Zum einen würde ich erstmal event-on-change / event-on-update und dann halt den FileLog so definieren, dass jedes Monat oder sogar jeden Tag ein neuer angelegt wird.

Alternativ kannst ja auch auf DB umstellen.
FHEM im Proxmox Container

Esteban

Moin!

Danke für die Tipps. Herrje... mal eine Woche nur spätabends kurz vorm Computer und den ganzen Tag heftige Gartenarbeit weil Urlaub - da kommt einem der Link zur Commandref irgendwie Spanisch vor!

Hättet ihr da ein konkretes Beispiel? Ansonsten muss ich das nächste Woche mal machen wenn wieder Zeit ist. :)
FHEM v5.9 auf RPi 3B+ Raspbian Stretch | Busware CUL 433 MHz | 20x IT-1500 | HMUSB2 mit diversen HM Komponenten

JensS

define Log_leeren at *06:00:00 {system("echo ' ' > ./log/TempBalkon-2016.log")}
sollte jeden Tag um 6 Uhr die Datei überschreiben.

Gruß Jens
Debian auf APU2C4, HM-CFG-USB2, SIGNALduino, HM-ES-PMSw1-Pl, TFA 30.3121, TFA 30.3125, ITS-150, PIR-5000, configurable Firmata USB & LAN, 1-wire: DS-18B20, DS-18S20, DS-2408, DS-2413, diverse I2C-Komponenten, zigbee2mqtt, ESPEasy etc.

max333

Ist es auch möglich, das Logfile auf z.B. die letzten 48 Stunden zu begrenzen?

Gruß max

justme1968

schau dir doch mal an wie der fileLog name definiert wird. du kannst tages, monats und jahreslogs ankegen und mit attributen festlegen wieviele logs aufgehoben werden sollen.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968