From ae917625029c235ad51b7ee281b0cdc848ae6a38 Mon Sep 17 00:00:00 2001 From: hpl Date: Sat, 21 Sep 2024 13:12:45 +0200 Subject: [PATCH] maj script cron paheko --- dockers/paheko/Dockerfile | 4 ++-- dockers/paheko/config/factory_cron.sh | 3 ++- dockers/paheko/config/factory_cron_emails.sh | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dockers/paheko/Dockerfile b/dockers/paheko/Dockerfile index a9c6eab..c5ce51f 100644 --- a/dockers/paheko/Dockerfile +++ b/dockers/paheko/Dockerfile @@ -15,8 +15,8 @@ RUN mkdir ${PAHEKO_DIR}/data/plugins/facturation && tar zxvf ${PAHEKO_DIR}/data/ #install cron pour factory_cron.sh RUN apt-get update && apt-get install cron joe rsyslog -y RUN sed -i '/imklog/s/^/#/' /etc/rsyslog.conf -RUN echo "0 1 * * * cd ${PAHEKO_DIR} && ${PAHEKO_DIR}/factory_cron.sh" >> /var/spool/cron/crontabs/root -RUN echo "* * * * * cd ${PAHEKO_DIR} && ${PAHEKO_DIR}/factory_cron_emails.sh" >> /var/spool/cron/crontabs/root +RUN echo "0 1 * * * cd ${PAHEKO_DIR} && ${PAHEKO_DIR}/factory_cron.sh 1> /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root +RUN echo "* * * * * cd ${PAHEKO_DIR} && ${PAHEKO_DIR}/factory_cron_emails.sh 1> /dev/null 2> /dev/null" >> /var/spool/cron/crontabs/root RUN chmod 600 /var/spool/cron/crontabs/root RUN sed -i "/exec/i\service cron start\n" /usr/local/bin/docker-php-entrypoint RUN ln -sf /usr/local/bin/php /usr/bin/ diff --git a/dockers/paheko/config/factory_cron.sh b/dockers/paheko/config/factory_cron.sh index 05bb4ec..932da40 100755 --- a/dockers/paheko/config/factory_cron.sh +++ b/dockers/paheko/config/factory_cron.sh @@ -7,7 +7,8 @@ FACTORY_USER_DIRECTORY="users" # Chemin vers le script cron.php de Paheko PAHEKO_CRON_SCRIPT="scripts/cron.php" -cd /usr/share/paheko +#cd /usr/share/paheko +cd /var/www/paheko for user in $(cd ${FACTORY_USER_DIRECTORY} && ls -1d */) do diff --git a/dockers/paheko/config/factory_cron_emails.sh b/dockers/paheko/config/factory_cron_emails.sh index eeed1b6..08b739c 100755 --- a/dockers/paheko/config/factory_cron_emails.sh +++ b/dockers/paheko/config/factory_cron_emails.sh @@ -7,6 +7,9 @@ FACTORY_USER_DIRECTORY="users" # Chemin vers le script emails.php de Paheko PAHEKO_CRON_SCRIPT="scripts/emails.php" +#cd /usr/share/paheko +cd /var/www/paheko + for user in $(cd ${FACTORY_USER_DIRECTORY} && ls -1d */) do PAHEKO_FACTORY_USER=$(basename "$user") /usr/bin/php $PAHEKO_CRON_SCRIPT