Zhang Huangbin avatar Zhang Huangbin committed b371b2a

Fixed: Add cron job to cleanup expired entries in Cluebringer database.

Comments (0)

Files changed (5)


     * Works on openSUSE-13.1 milestone 4.
     * Switch from Policyd-1.8 to Cluebringer on all Linux/BSD distributions,
       with easier white/black/greylisting management.
+    * Fixed:
+        + Add cron job to cleanup expired entries in Cluebringer database.
     * Drop support for below releases:
         + Debian 6 (squeeze)
         + Gentoo


 export CLUEBRINGER_RC_SCRIPT_NAME='cluebringer'
+# Path to cbpadmin.
+# cbpadmin is responsible for deleting old entries from the database.
+export CLUEBRINGER_BIN_CBPADMIN='/usr/sbin/cbpadmin'
 # Database.
 export CLUEBRINGER_DB_NAME='cluebringer'
 export CLUEBRINGER_DB_USER='cluebringer'
     export CLUEBRINGER_USER='policyd'
     export CLUEBRINGER_GROUP='policyd'
+    export CLUEBRINGER_BIN_CBPADMIN='/usr/local/bin/cbpadmin'
     export PKG_CLUEBRINGER='policyd2'
     export CLUEBRINGER_CONF='/usr/local/etc/cluebringer.conf'
     export CLUEBRINGER_WEBUI_CONF="${HTTPD_CONF_DIR}/cluebringer.conf"


     ECHO_DEBUG "Setting cronjob for awstats."
     cat >> ${CRON_SPOOL_DIR}/root <<EOF
+# ${PROG_NAME}: update Awstats statistics
 1   */1   *   *   *   perl ${AWSTATS_CGI_DIR}/awstats.pl -config=web -update >/dev/null
 1   */1   *   *   *   perl ${AWSTATS_CGI_DIR}/awstats.pl -config=smtp -update >/dev/null


     # Add postfix alias.
     add_postfix_alias ${CLUEBRINGER_USER} ${SYS_ROOT_USER}
+    # Add cron job
+    cat >> ${CRON_SPOOL_DIR}/root <<EOF
+# ${PROG_NAME}: Cleanup Cluebringer database
+1   3   *   *   *   ${CLUEBRINGER_BIN_CBPADMIN} --config=${CLUEBRINGER_CONF} --cleanup >/dev/null
     # Tips.
     cat >> ${TIP_FILE} <<EOF
 Policyd (cluebringer):


     chown -R ${DOVECOT_USER}:${DOVECOT_GROUP} ${dovecot_expire_dict_dir} && \
     chmod -R 0750 ${dovecot_expire_dict_dir}
-    if [ X"${DISTRO}" == X"RHEL" ]; then
-        ECHO_DEBUG "Setting cronjob for Dovecot plugin: Expire."
-        cat >> ${CRON_SPOOL_DIR}/root <<EOF
-#1   5   *   *   *   ${DOVECOT_BIN} --exec-mail ext $(eval ${LIST_FILES_IN_PKG} dovecot | grep 'expire-tool$')
-    fi
 # Use dovecot deliver program as LDA.
 dovecot unix    -       n       n       -       -      pipe
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.