drupal-php icon indicating copy to clipboard operation
drupal-php copied to clipboard

Crontabs not working as expected

Open michael-niemand opened this issue 5 years ago • 0 comments

using wodby/drupal-php:7.3-dev-4.15.9

I'm having a hard time understanding how the crontabs are supposed to work.

in the docker-entrypoint.sh there is the following snippet:

# @deprecated will be removed in favor of bind mounts (config maps).
init_crond() {
    if [[ -n "${CRONTAB}" ]]; then
        _gotpl "crontab.tmpl" "/etc/crontabs/www-data"
    fi
}

Ok, using env var CRONTAB is deprecated, so lets use a crontab file mounted at /etc/crontabs/www-data instead ... but then there is this snipped in the /usr/local/bin/init_container script, which is called as sudo from the entrypoint script:

if [[ -f /etc/crontabs/www-data && -z "${CRONTAB}" ]]; then
    chown root:www-data /etc/crontabs/www-data
    chmod 660 /etc/crontabs/www-data
fi

this fails of course, when the crontab is mounted as a configmap like I did:

chown: /etc/crontabs/www-data: Read-only file system

In the official documentation I only found small snippets that don't really explain how to actually get a working crontab into the container. Please advise, anything helps. Thank you!

michael-niemand avatar Jan 12 '21 09:01 michael-niemand