Is it possible to delete servers history for a device?

mikekgr 8 years ago

Dear Sirs,
I am using the latest traccar server and I am looking for an easy way to delete the history for one or more devices. Is this a feature that Web interface support or I need other way? Please be specific because I am not experienced in this field...

Thanks and Best Regards,
Mike Kranidis

Anton Tananaev 8 years ago

No, the only way to delete data for some subset of devices is directly through the database.

mikekgr 8 years ago

Thanks

imarinkovic 8 years ago

Sorry for bringing this up again, but when I try to delete an old device with a lot of history, the following error came on screen:

Communications link failure

The last packet successfully received from the server was 15,923 milliseconds ago.  The last packet sent successfully to the server was 15,923 milliseconds ago. - CommunicationsException (... < QueryBuilder:475 < DataManager:229 < DeviceManager:230 < ...)

Obviously is a timeout problem, Can be managed via Traccar?

Best regards,
Ivan

Anton Tananaev 8 years ago

You should increase MySQL server timeout. There is nothing Traccar can do about it.

imarinkovic 8 years ago

Ok Anton, thanks for answering.

imarinkovic 8 years ago

For all to know, the problem about "Communications link failure" was triggered for problems with server memory capacity. Deleting a large set of data made mysql OOM-killed. Installed more memory and problem disappeared.

Thanks Anton for this awesome work.

Dariusz 6 years ago
delete FROM tc_positions where  servertime < now() - interval 8 DAY and (deviceid = 155 or deviceid = 64 or deviceid = 79 or deviceid = 99) 
Dariusz 6 years ago

any idea for delete history older for GroupID ?

tc_groups.groupid = 3
Dariusz 6 years ago
tc_positions.deviceid = tc.devices.id WHERE tc_devices.groupid = 3
Dariusz 6 years ago
delete tc_positions.* FROM `tc_positions` LEFT JOIN tc_devices ON  deviceid = tc_devices.id  WHERE groupid = 28 and servertime < now() - interval 1 DAY

works like I want :)

Vani 5 years ago

Where do i need to place this code? delete tc_positions.* FROM tc_positions LEFT JOIN tc_devices ON deviceid = tc_devices.id WHERE groupid = 28 and servertime < now() - interval 1 DAY

Dariusz 5 years ago

I'm using phpmyadmin site ....