Cron not working after adding Redis

I have been working on this for about a week.

This is the current error for cron Some jobs have not been executed since 4 days ago. Please consider increasing the execution frequency.

I used portainer with the following. cron was working before I added redis. I ran this sudo crontab -u www-data -e and added */5 * * * * php -f /var/www/nextcloud/cron.php–define apc.enable_cli=1

container

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed

    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=changed #change this
      - MYSQL_PASSWORD=changed #change this
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
  redis:
    container_name: ncredis
    image: redis
    restart: unless-stopped
    command: redis-server
    

  app:
    image: nextcloud
    restart: always
    ports:
      - 8888:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=changed #change this to match the mysql_password above
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      - REDIS_HOST=redis
      - REDIS_PORT=6379

php -f /var/www/nextcloud/cron.php –define apc.enable_cli=1

(should be a space)

You might also check your system cron logs and your nextcloud.log

2 Likes

Thanks, I made that update to crontab. one thing I noticed is if I run sudo docker exec -u www-data nextcloud-app-1 php /var/www/html/cron.php on the host the cursor moves to the next line but nothing happens. I am seeing a lot of cron information in the nextcloud logs so it appears to be running. Is there a different place I need to updated to include --define apc.enable.cli=1?

I can see cron jobs ran in the logs. I still see Some jobs have not been executed since 5 days ago. Please consider increasing the execution frequency.