all-in-one/Containers/nextcloud/cron.sh
Simon L. d99d0240e0 nextcloud container - add exit to cronjob
Signed-off-by: Simon L <szaimen@e.mail.de>
2024-04-10 11:53:12 +02:00

20 lines
346 B
Bash

#!/bin/bash
set -eu
wait_for_cron() {
set -x
while [ -n "$(pgrep -f /var/www/html/cron.php)" ]; do
echo "Waiting for cron to stop..."
sleep 5
done
echo "Cronjob successfully exited."
exit
}
trap wait_for_cron SIGINT SIGTERM
while true; do
php -f /var/www/html/cron.php &
sleep 5m &
wait $!
done