Replace alpine atd with crond

This commit is contained in:
myve 2025-12-16 04:19:41 +00:00
commit 8191d6f2d1
2 changed files with 34 additions and 24 deletions

View file

@ -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 \

View file

@ -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/