all-in-one/Containers/nextcloud/cron.sh

21 lines
346 B
Bash
Raw Normal View History

#!/bin/bash
2021-11-30 11:20:42 +01:00
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
2021-11-30 11:20:42 +01:00
while true; do
php -f /var/www/html/cron.php &
sleep 5m &
wait $!
2021-11-30 11:20:42 +01:00
done