History Cleanup

Rvendrame 5 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 Tananaev 5 years ago

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

Rvendrame 5 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 Tananaev 5 years ago

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

jay 5 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);

Rvendrame 5 years ago

Thanks @jay!

Carlos 5 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.

limparhistorico 4 years ago

@ja only this, you are de best