Remove obsolete *.log-files from openLDAP DB-folder

If you use the openLDAP-server you will probably run into the problem that the *.log-files located in the DB’s folder will comsume more and more free space.
It seems that the automatic maintenance service that should clean up no longer used log-files is somehow broken.
Luckly there is a command that removes any log-files that aren’t needed any more:

db_archive -d -h

In CentOS, the DB files normally reside at /var/lib/ldap, so the resulting line would be:

db_archive -d -h /var/lib/ldap

Of couse, you could also add this as a daily cronjob:

# LDAP DB maintenance
0 3 * * * /usr/bin/db_archive -d -h /var/lib/ldap

2 Kommentare

  1. hayou

    you can set :

    set_flags DB_LOG_AUTOREMOVE

    on /var/lib/ldap/DB_CONFIG

    Antworten
    1. chris (Beitrag Autor)

      Thanks for your comment.
      This is true, but unfortunately this feature does not work as expected. From my observations the autoremove is only done once when the service is (re-)started and NOT repeated periodically as one would assume.
      That’s the main reason for my approach using cron.

      Antworten

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.