#!/usr/bin/sh #------------------------------------------------------------------------------ # /var/install/bin/roundcube-cron - cron job wrapper script # # Copyright (c) 2012-2025 The Eisfair Team, team(at)eisfair(dot)org # # Creation : 2013-01-08 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ pgmname=`basename $0` module_name="`echo "${pgmname}" | cut -d- -f1 | cut -d. -f1`" roundcubefile=/etc/config.d/${module_name} #exec 2> /tmp/${module_name}-cron-trace$$.log #set -x logfile=`/usr/bin/mktemp -t ${module_name}-cron-XXXXXXXXXX.log` rm -f ${logfie} ### load configuration ### . ${roundcubefile} rc_nbr=1 while [ ${rc_nbr} -le ${ROUNDCUBE_N} ] do eval active='$ROUNDCUBE_'${rc_nbr}'_ACTIVE' if [ "${active}" = "yes" ] then eval doc_root='$ROUNDCUBE_'${rc_nbr}'_DOCUMENT_ROOT' break fi rc_nbr=`expr ${rc_nbr} + 1` done ret=0 if [ -f ${doc_root}/bin/cleandb.sh ] then { chmod 0544 ${doc_root}/bin/cleandb.sh ${doc_root}/bin/cleandb.sh } >${logfile} 2>&1 ret=$? if [ ${ret} -ne 0 ] then echo 'Error during cron script execution!' echo echo '-- start of cron log --' cat ${logfile} echo '-- end of cron log --' fi fi rm -f ${logfile} exit ${ret}