Closed smailpouri closed 1 year ago
I'm sorry but I can't help you with that. I'm not a mac user and have no experience with the operating system.
Your procedure seems to be right. The only issue I can spot is that you should run preview:pre-generate
in your cron job instead of preview:generate-all
. The command preview:generate-all
should only be run once before you set up the cron job.
I ended up using this:
https://hub.docker.com/r/rcdailey/nextcloud-cronjob/dockerfile
my docker-compose file if that helps
version: '2'
volumes:
nextcloud:
db:
config:
services:
db:
image: mariadb:10.5
container_name: db
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- TZ=${TZ}
- PUID=${PUID}
- PGID=${PGID}
app:
image: nextcloud
hostname: nextcloud
container_name: nextcloud
restart: unless-stopped
ports:
- 8383:80
links:
- db
volumes:
- nextcloud:/var/www/html
#Add any path that you want to be able to access in nextcloud with "External Storage"
- /ADDITIONAL_PATH:/FOLDER01
- /ADDITIONAL_PATH:/FOLDER02
environment:
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- TZ=${TZ}
- PUID=${PUID}
- PGID=${PGID}
cron:
image: rcdailey/nextcloud-cronjob
restart: unless-stopped
network_mode: none
depends_on:
- app
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /etc/localtime:/etc/localtime:ro
- /PATHtoFOLDER:/cron-scripts:to #additional cron job
environment:
- NEXTCLOUD_CONTAINER_NAME=nextcloud
VARIABLE will need to be set. I'm using a Stack in Portainer and setting my variable there.
Hopefully that helps someone.
Excellent! Thanks a lot for following up.
Hi,
Is this a correct pratice?
MacMIni M1 macOS 12.6 Docker 4.12 (latest) nextcloud docker-compose:
Once in Nextcloud instance, I added Preview Generator through nextcloud AppStore.
From macOS Terminal Command = WORKS
docker exec -u www-data nextcloud ./occ preview:generate-all
Is this the correct procedure? How do Iknow if it works?
I don't understand if this should be done on the system side or on the docker container side, I don't know how to add this into a crontab either.
From macOS terminal I tried:
sudo su
entered password
sh-3.2# crontab -e
I get a terminal window:
Click on "I" add this under the line mentioned above:
Pres "ESC" then ":wq"
I don't know if its related but I'm getting this error in the Nextcloud overview page: >Last background job execution ran 4 hours ago. Something seems wrong
That being said if I'm not mistaken I created a corn job in my macOS system so I'm gonna assume it is related to something else?