History Cleanup

Rvendrame4 years ago

Hello Traccar community,

What is the difference between this

https://www.traccar.org/clear-history/

and this

 <entry key='database.historyDays'>10</entry>

? All that I wanted is to keep the last XX days of tracking history in my Traccar database (Mariadb in this case).

Thanks!

Anton Tananaev4 years ago

Configuration option is removed. It is recommended to use external script, like in the documentation you referring to.

Rvendrame4 years ago

Hi Anton, thanks for the quick reply. I'm not expert / brave enough to adopt the scripts for running inside docker container (I run Traccar as a Home Assistant add-on). It is sad the config option was removed, it would be great for noobs like me. Any plan to implement a option like that in the server UI ?

Anton Tananaev4 years ago

It was removed for a reason - it didn't work well.

jay4 years ago

mysql -u root -p

Enter password:******

mysql> use traccar;

Database changed

delete from tc_positions where servertime < DATE(NOW() - INTERVAL 180 day);
delete from tc_statistics where capturetime < DATE(NOW() - INTERVAL 180 day);
delete from tc_events where servertime < DATE(NOW() - INTERVAL 180 day);

Rvendrame4 years ago

Thanks @jay!

Carlos4 years ago

Hey jay can you help me? I need to clear the memory on my ec2 instance and don't know how, my /dev/xvda1 folder is almost full. I have access thru putty ssh.

limparhistorico3 years ago

@ja only this, you are de best