i just run them as cron jobs on the host. put them in small skript /usr/local/bin/nextcloud_optimize.sh
and put this roots crontab.
any reason for this?
did you try to copy the cron.sh to your host, add your tasks and run the container like this:
cron:
image: nextcloud:apache
restart: always
volumes:
- nextcloud:/var/www/html
- /path/to/your/cron.sh:/crons.sh:ro
entrypoint: /cron.sh
depends_on:
- db
- redis