0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-06-16 16:14:47 +02:00

Replace crond with a while loop.

Adding the cron command to  /var/spool/cron/crontabs/www-data assumes
that cron, and by extension the nextcloud app, is run as 'www-data'.

'crond' cannot be used with:
exec "echo \"*/%%CRONTAB_INT%% * * * * php -f /var/www/html/cron.php\" | crontab - && crond -f -l 0 -L /dev/stdout"
because that assumes the uid used matches a entry in '/etc/passwd'.

Signed-off-by: Roland Vet <vet.roland@gmail.com>
This commit is contained in:
Roland Vet 2021-04-06 12:56:35 +02:00
parent e26adedbdb
commit 0c7ef56635
4 changed files with 10 additions and 8 deletions

View file

@ -1,4 +1,7 @@
#!/bin/sh
set -eu
exec busybox crond -f -l 0 -L /dev/stdout
while [ 1 ]; do
(php -f /var/www/html/cron.php &);
sleep %%CRONTAB_INT%%m;
done