Skip to content

Instantly share code, notes, and snippets.

@Arturro43
Created July 28, 2023 02:17
Show Gist options
  • Save Arturro43/87c82ed3e35aaf4c0d002aa17437062b to your computer and use it in GitHub Desktop.
Save Arturro43/87c82ed3e35aaf4c0d002aa17437062b to your computer and use it in GitHub Desktop.
Nextcloud Cron [docker]
version: '3.7'
services:
app:
image: nextcloud:apache
cron:
image: rcdailey/nextcloud-cronjob
restart: always
network_mode: none
depends_on:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
environment:
- NEXTCLOUD_CONTAINER_NAME=Nextcloud
- NEXTCLOUD_CRON_MINUTE_INTERVAL=5
@Arturro43
Copy link
Author

Arturro43 commented Apr 26, 2024

As TasyDevilsky pointed out, you can also use crontab:

On your system:

crontab -e

Add this line to the bottom */5 * * * * docker exec -u www-data Nextcloud php /var/www/html/cron.php

PS: Nextcloud is name of your container, if you used marketplace it should be Nextcloud :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment