Disk full in server

Greetings to all I hope that they are well ..

I have a server with traccar mounted in ubuntu:

Ubuntu 14.04.5 LTS
3 GB of RAM
40 GB of disk

The issue is that in opt / traccar there is a folder called logs, when the logs reach the size of the disk the traccar system stops working and I have to clean the logs files and restart the traccar services.

I want to know if there is a better way to deal with this problem, I want to know if it is some configuration parameter or something that allows me to clean the files without needing to restart the services of the traccar.

Thank you.

Anton Tananaev6 years ago

Just use a script to remove old log files. Something like this:

printf '#!/bin/sh\nfind /opt/traccar/logs/ -mtime +5 -type f -delete\n' > /etc/cron.daily/traccar-clear-logs && chmod +x /etc/cron.daily/traccar-clear-logs

Hello Anton ... thanks for answering ... in reference to this point I want to ask you a question ... in the folder opt / traccar / logs ... there is a file called: tracker-server.log in some cases this file increases so much the size that the other files logs only weights KB while this file takes to weigh MB and up to GB.

When the less heavy files are cleaned the KB files, free or clean the tracker-server.log file?

Anton Tananaev6 years ago

Have you checked what's in the file? If it grows out of control, it likely means that you have a different issue that you need to address in the first place.

Hi Anton...

Hello Anton ...

If I have reviewed it ... I put a little bit almost always repeats the same.

2018-09-17 06:25:14  WARN: The table 'positions' is full - SQLException (... < QueryBuilder:475 < DataManager:301 < DefaultDataHandler:27 < ...)
2018-09-17 06:25:14  INFO: [01848465] id: 865205030322415, time: 2018-09-17 14:24:37, lat: 41.63535, lon: 0.81006, speed: 45.5, course: 260.0
2018-09-17 06:25:15  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:18  INFO: [93957C43] id: 865205031881112, time: 2018-09-17 14:24:29, lat: 37.25520, lon: -5.57317, speed: 37.5, course: 75.0
2018-09-17 06:25:18  WARN: Geocoding failed - Handshake did not complete within 10000ms - ConnectException (...)
2018-09-17 06:25:18  INFO: [0032D621] id: 865205031876716, time: 2018-09-17 06:25:11, lat: 39.21137, lon: -0.50211, speed: 0.0, course: 0.0
2018-09-17 06:25:18  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:18  INFO: [0FB0AA18] id: 865205030322282, time: 2018-09-17 14:24:37, lat: 41.31075, lon: 2.07509, speed: 0.0, course: 0.0
2018-09-17 06:25:18  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:18  INFO: [566D423F] id: 355020151222073, time: 2018-09-17 06:25:07, lat: 37.87748, lon: -4.75995, speed: 20.0, course: 239.0
2018-09-17 06:25:18 DEBUG: [24BC29A4: 5013 < 77.211.47.187] HEX: 2a48512c3836353230353033303332323337332c56312c3138323530332c412c343032312e35313431332c4e2c30303031392e30373338362c452c34372e32312c3232322c3137303931382c4646464646464646230d0a2a48512c3836353230353033303332323337332c56312c3138323531332c412c343032312e34323031392c4e2c30303031382e39353632312c452c34362e38342c3232362c3137303931382c4646464646464646230d0a
2018-09-17 06:25:19  INFO: [D93CC14B] id: 865205030321813, time: 2018-09-17 14:24:30, lat: 51.52417, lon: 7.43750, speed: 24.4, course: 271.0
2018-09-17 06:25:19  WARN: Geocoding failed - Handshake did not complete within 10000ms - ConnectException (...)
2018-09-17 06:25:20  INFO: [0AF76773] id: 865205031881757, time: 2018-09-17 14:24:37, lat: 41.33258, lon: 2.11758, speed: 0.0, course: 0.0
2018-09-17 06:25:20  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:20 DEBUG: [681B8D91: 5013 < 185.3.54.12] HEX: 2a48512c3836353230353033303733323533302c48544254230d0a
2018-09-17 06:25:20  INFO: [9AD6743F] id: 865205031876450, time: 2018-09-17 14:24:37, lat: 36.60440, lon: -6.19208, speed: 0.0, course: 0.0
2018-09-17 06:25:20  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:21 DEBUG: [41AA1288: 5005 < 88.31.213.207] HEX: 244750524d432c3130323530352e3030302c412c333932382e373933322c4e2c30303032362e373038362c572c362e38362c3130382e33392c3137303931382c2c2a31640d0a
2018-09-17 06:25:21 DEBUG: [41AA1288: 5005 > 88.31.213.207] HEX: 4f4b310d0a
2018-09-17 06:25:21 DEBUG: [E301B76B: 5013 < 185.3.54.12] HEX: 2a48512c3836353230353033313837363933302c56312c3138323530362c412c343134312e37313336302c4e2c30303034342e35373834332c452c302e30302c302c3137303931382c4646464646424646230d0a2a48512c3836353230353033313837363933302c56312c3138323531362c412c343134312e37313336302c4e2c30303034342e35373834332c452c302e30302c302c3137303931382c4646464646424646230d0a
2018-09-17 06:25:25  INFO: [7951CB7D] id: 865205031556045, time: 2018-09-17 06:25:30, lat: 41.49134, lon: 1.91191, speed: 32.8, course: 204.0
2018-09-17 06:25:25  WARN: Geocoding failed - Handshake did not complete within 10000ms - ConnectException (...)
2018-09-17 06:25:26  INFO: [E0A90B10] id: 865205031877177, time: 2018-09-17 14:24:26, lat: 41.59903, lon: 1.61743, speed: 49.8, course: 216.0
2018-09-17 06:25:26  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:27  INFO: [1A77C5EF] id: 865205030323306, time: 2018-09-17 14:24:33, lat: 36.87457, lon: -2.44149, speed: 0.0, course: 0.0
2018-09-17 06:25:27  WARN: Geocoding failed - Handshake did not complete within 10000ms - ConnectException (...)
2018-09-17 06:25:27  INFO: [BE5796E7] id: 865205030155542, time: 2018-09-17 14:24:08, lat: 42.30811, lon: -8.10827, speed: 48.3, course: 103.0
2018-09-17 06:25:28  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:29  INFO: [E301B76B] id: 865205031876930, time: 2018-09-17 14:24:36, lat: 41.69523, lon: 0.74297, speed: 0.0, course: 0.0
2018-09-17 06:25:29  WARN: Geocoding failed - Empty address - GeocoderException (JsonGeocoder:74 < ...)
2018-09-17 06:25:30  INFO: [1759110D] id: 865205030322332, time: 2018-09-17 14:24:31, lat: 39.96867, lon: -3.54726, speed: 0.0, course: 0.0
2018-09-17 06:25:30  WARN: Geocoding failed - Handshake did not complete within 10000ms - ConnectException (...)
Anton Tananaev6 years ago

This just shows that your disk is full already. You need to find what lead to it. Also, it seems like geocoding is consistently failing for you, so I would recommend disabling it.

What I'm showing you is a log file that we took minutes after we cleaned the system and removed all the temporary system had stopped responding.
Anton ... this will have to do with that in the maximum connections of Mysql I have value 150? or this has nothing to do?

Geographical coding where can I disable it? is this? <entry key="geocoder.enable">true</entry>

Anton Tananaev6 years ago

You need to look at the log when log begins to grow quickly. Not after you cleaned it.

Geocoding can be disabled in the config. Before asking questions like this, please read documentation.

Anton ... you talk to me about geocoding ... but in the documentation as well as in the configuration file, it speaks of Geocoder ... that's why I'm writing the question to you since I'm not sure it's the same.

Anton Tananaev6 years ago

What is not the same? Geocoder and Geocoding? Obviously it's the same thing. It's the same word.

Thanks for clarifying ... Anton ... what can you recommend to verify to know what is causing the geocoding service to fail so much?

Anton Tananaev6 years ago

What geocoder are you using? Google without API key? It almost never works.

Yes... is google....i understand....
Which one would you recommend?

Hi Anton... i have a question...

If i change config archive of traccar... i duty restart of services of traccar?

Anton Tananaev6 years ago

If you change configuration you need to restart service.