Last CronJob 12 Hour ago something is wrong

I get this message

I can’t use the manual because I’m runing my nextcloud into a docker. The command are different.

What do I have to do to make cron work?

The easiest way is to run a second container of the nextcloud image with the cron.sh entrypoint :+1:

Here’s the excerpt from our docker-compose.yml:

cron:
image: nextcloud:19
restart: always
volumes:
- data:/var/www/html
entrypoint: /cron.sh
depends_on:
- db

So you suggest me to start a new container in docker withe nextcloud? Want do you mean by entry point in corn.she?

In my words, I would create a new folder inside docker and setup everything to this new folder. As I understand there will be no contact point to the running system. How can this help to activate the crown?
I’ m sorry but I’m quite new in this nextcloud system.

If you’re using the official Docker builds from Nextcloud, the cron.sh file is already there in the root directory. The default entrypoint of the Docker image runs the web server. But you can change it to run the cron job.

Okay, thanks for the reply!
I have absolutely not clue what I have to do.
What is an entrypoint?

Why are you running it as a Docker container if you don’t know how to do it? :wink:

The entrypoint is the program that is started inside your container when you run it. :slight_smile:

ok I started a new nextcloud1 container, actually it is not started yet,

Do I chose the same folder as the main installation, like this?

How do I change the entrypoint?

And what do you mean by depends on db?

Yes you should use the same path, as this is a persistent volume and you want to have the same files mounted inside the container :+1:

I’m not sure how to change the mount point in your configuration. I’m using a docker-compose.yml in Docker Swarm, so this might be a little different for you. You could try to ask Google how to change the entrypoint in your Docker environment.

Depends on: db means that my nextcloud container should only start if the db container with the database is running. I think it’s optional.

at least this works in the hosts crontab:
docker exec --user www-data php -f cron.php > /dev/null 2>&1

Yes, but like this you have to run the command every time again after updating or restarting your container… If you have a separate container in your stack with the cron.sh entrypoint you don’t have to think about it :wink:

not really - I suggested to use root’s crontab on the host in order to execute the command every 5 minutes automatically.
execute on the host
sudo crontab -e
insert the following line replacing "your-nextclozd-container by the real name of the relevant container
*/5 * * * * docker exec --user www-data your-nexcloud-container php -f cron.php
and save .
thats all :slight_smile: cron.php will be execuded within your container every 5 minutes.

1 Like

Ok, yes that works, too :+1:

Okay I did this command I did not get any error, so I assume it worked. The problem ist, that I don’t know what it did to be honest.

I also finde this version 2, a planed task on my nas

I know it’s german, but it create a task and update every 15 minutes. Since then I have this message
In nc overwiev it says everything okay

But in settings it says there is a older problem

The German website explains how to add a webcron, which is basically the same what @misiunt proposed. So if you can do it inside your Synology, I think this is the easiest way to do it :slight_smile:

Btw, the default value for the cron jobs in the cron.sh entrypoint is to run every 5 minutes, but 15 minutes are also fine :+1:

Try switching to Webcron :slight_smile:

it changes from orange to red …

Could you please show us how you created your scheduled task in your Synology?

Looks good to me. Have you tried to access the URL manually in a browser? At least in Firefox I could see a success message from my Nextcloud that is configured to use Webcron. Perhaps your URL is only reachable from the Internet?

if I type it into chrome I get…
{“data”:{“message”:“Backgroundjobs are using system cron!”},“status”:“error”}

Ok, in this case it seems that the cron setting hasn’t really be changed to Webcron…