From 8191d6f2d16c8a69496e068cc61dc079ba4cbe77 Mon Sep 17 00:00:00 2001 From: myve Date: Tue, 16 Dec 2025 04:19:41 +0000 Subject: [PATCH] Replace alpine atd with crond --- build/Dockerfile.alpine | 2 +- build/run/docker-entrypoint/init.d/50-cron.sh | 56 +++++++++++-------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/build/Dockerfile.alpine b/build/Dockerfile.alpine index af335ce..5aad80a 100644 --- a/build/Dockerfile.alpine +++ b/build/Dockerfile.alpine @@ -28,7 +28,7 @@ RUN printf '%s\n' "https://dl-cdn.alpinelinux.org/alpine/${apkrepo:-latest-stabl && apk update \ && apk upgrade \ && apk add --no-cache \ - bash bash-completion ncurses at rsync grep coreutils \ + bash bash-completion ncurses rsync grep coreutils \ nginx \ mariadb mariadb-client mariadb-server-utils \ ca-certificates acl \ diff --git a/build/run/docker-entrypoint/init.d/50-cron.sh b/build/run/docker-entrypoint/init.d/50-cron.sh index dfe58b2..c7ba001 100755 --- a/build/run/docker-entrypoint/init.d/50-cron.sh +++ b/build/run/docker-entrypoint/init.d/50-cron.sh @@ -1,28 +1,38 @@ #!/usr/bin/env bash +# Crond +if [ ! -d /etc/periodic/ ] +then + echo "Cron not detected, exiting..." + exit 1 +fi +ln -s /usr/share/webapps/roundcube/bin/cleandb.sh /etc/periodic/daily/roundcube-cleandb +ln -s /usr/local/bin/postwhite/postwhite /etc/periodic/daily/postwhite +ln -s /usr/local/bin/postwhite/scrape_yahoo /etc/periodic/weekly/postwhite_scrape_yahoo +crond -b -l 0 -L /var/log/mail/cron.log -# Start at daemon -atd - -# Roundcube cleanup (daily) -while true -do - at -f /usr/share/webapps/roundcube/bin/cleandb.sh midnight - sleep 1d -done & - -# Update Postscreen Whitelists (daily) -while true -do - at -f /usr/local/bin/postwhite/postwhite midnight - sleep 1d -done & - -# Update Yahoo! IPs for Postscreen Whitelists (weekly) -while true -do - at -f /usr/local/bin/postwhite/scrape_yahoo midnight sunday - sleep 7d -done & +# # Start at daemon +# atd +# +# # Roundcube cleanup (daily) +# while true +# do +# at -f /usr/share/webapps/roundcube/bin/cleandb.sh midnight +# sleep 1d +# done & +# +# # Update Postscreen Whitelists (daily) +# while true +# do +# at -f /usr/local/bin/postwhite/postwhite midnight +# sleep 1d +# done & +# +# # Update Yahoo! IPs for Postscreen Whitelists (weekly) +# while true +# do +# at -f /usr/local/bin/postwhite/scrape_yahoo midnight sunday +# sleep 7d +# done & # # Refresh ssl keys daily # # https://www.golinuxcloud.com/renew-self-signed-certificate-openssl/