[Resolved] [/var/log] : do the cleaning properly

My YunoHost server

**Hardware: Odroid N2+/N2/Helios 64 (3 ARM board)
YunoHost version: 4.1.7.1 (stable)
I have access to my server : Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Hello everyone,
I am writing this message in English even if my language is French because I have read this post (The language barrier - #23 by ljf).
I think it’s good that YNH reaches the widest audience but I also think that writing in French should remain a possibility (I will do it again often; I write too badly in English :)).

So my problem is that sometimes I get the message in the diagnostics that the storage space / var / log is almost full.

2 questions:
a) this message does not appear all the time and the space used varies => are some logs only temporary ?
b) how to clean in var / log to save space ?

Thxs a lot !

Hello,

Logs are handled by logrotate, which is a utility that monitors the number and the size of logs per app. There are per-app settings, but basically if there are more than X log files, and their size exceeds some MB, they logrotate will come and compress older logs. Later, when compressed logs are again too many, the older ones are deleted.

You can check which logs are too many/big with ncdu /var/log (run apt install ncdu beforehand to install it). It will show you the directory tree along with the size of its elements.

You can delete selected elements with by typing d. I would advise you to only delete compressed .gz logs, and archived ones (ending with .log.1, .log.2 and so on).

If you are unhappy with the configuration of logrotate for one app, you can check it out in /etc/logrotate.d. Feel free to open an issue in the app’s repository if you think the community could benefit from an optimized logrotate rule.

1 Like

Hello tituspijean,

Thks for your answer.

Logs are handled by logrotate, which is a utility that monitors the number and the size of logs per app. There are per-app settings, but basically if there are more than X log files, and their size exceeds some MB, they logrotate will come and compress older logs. Later, when compressed logs are again too many, the older ones are deleted.

OK I understood.

You can check which logs are too many/big with ncdu /var/log (run apt install ncdu beforehand to install it). It will show you the directory tree along with the size of its elements.

The output of ncdu /var/log (thanks for the tip) is :

*/var/log -----------------------------------------------------------------------------------------------------------------------------------------------------*
*    3.6 MiB [##########]  syslog*
*    3.3 MiB [######### ]  daemon.log*
*    2.6 MiB [#######   ] /jellyfin*
*    1.0 MiB [##        ] /samba*
*  624.0 KiB [#         ]  syslog.1.gz-2020101412.backup*
*  592.0 KiB [#         ]  daemon.log.1.gz-2020101412.backup*
*  416.0 KiB [#         ] /nginx*
*  384.0 KiB [#         ]  syslog.1.gz-2020121800.backup*
*  356.0 KiB [          ] /yunohost*
*  272.0 KiB [          ]  user.log*
*  264.0 KiB [          ]  messages*
*  204.0 KiB [          ]  syslog.1.gz-2020122000.backup*
*  184.0 KiB [          ]  daemon.log.1.gz-2020122000.backup*
*  172.0 KiB [          ]  syslog.1.gz-2020101621.backup*
*  160.0 KiB [          ]  daemon.log.1.gz-2020101621.backup*
*   88.0 KiB [          ] /apt*
*   44.0 KiB [          ]  backup_borg.err*
*   24.0 KiB [          ] /rabbitmq*
*   20.0 KiB [          ] /metronome*
*e  16.0 KiB [          ] /lost+found*
*   16.0 KiB [          ]  auth.log*
*   16.0 KiB [          ] /lightdm*
*    8.0 KiB [          ] /rspamd*
*    8.0 KiB [          ]  mail.log*
*    8.0 KiB [          ]  mail.info*
*    8.0 KiB [          ] /redis*
*    8.0 KiB [          ]  Xorg.0.log.old*
*    8.0 KiB [          ]  auth.log.1.gz-2020101412.backup*
*    4.0 KiB [          ] /unattended-upgrades*
*e   4.0 KiB [          ] /sysstat*
*e   4.0 KiB [          ] /speech-dispatcher*
*e   4.0 KiB [          ] /private*
*    4.0 KiB [          ] /postgresql*
*e   4.0 KiB [          ] /openvpn*
*    4.0 KiB [          ] /openhab2*
*e   4.0 KiB [          ] /ntpstats* 

The sizes look OK but I will check that sometimes.
The “e” in the first colum means empty ?
Thanks for all

You are welcome!

Indeed the directory looks quite light. Had you cleaned it up before?

e means empty, indeed. You can get information on ncdu with man ncdu, or on its website.

Had you cleaned it up before?

No I haven’t…or maybe but I don’t remember :slight_smile:

You can get information on ncdu with man ncdu, or on its website.

OK Thks. Nice afternoon !

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.