Owncloud 9.1 Ubuntu 16.04 Cronjob not working

9.1.x
help

#1

Hey guys, I got an OwnCloud 9.1.1 running on an Ubuntu 16.04 dekstop.
But I have some problems with cronjobs.

At the "Personal"-settings tab I activated email notifications for the administrator user, whenever a given activity happens like someone creates a new folder.
But I'm afraid I get no mails when somebody does those things.

At "Administrator > Email-Server" I configured everything correctly (I guess), as the test mail works properly.

If I continue then to look at the cron settings and set it on "Cron" as it is default, I get a notification like (transalted) "Last cron job execution: X hours ago. There's probably an error."
I thought, that's the problem, but when set the thing on "AJAX", everything I refresh the page it says someting like (translated) "Last cron job execution: Just now."

As I'm no Linux expert, I have no idea where to look next for the error.


#2

have you singleuser-mode activated?

can you look at your shell (SSH) and tell us if there's an entry like (by typing: crontab -u www-data -l):

*/15 * * * * php -f /var/www/html/owncloud/cron.php


#3

I have plenty of users in use, so I guess I have not?

The command gives me a "no crontab for www-data".
Don't know if it's important, but may be: I have no "/var/www/html/owncoud/cron.php", for me it's "/var/www/owncloud/cron.php"


#4

go to your config.php and check if you have an entry like this enabled:

'singleuser' => true,

#5

(Edited above answer.)

No, there's no such entry as 'singleuser' in my config.php


#6

Well, thats your issue. Please follow the documentation at the following link as just setting the background job to "cron" won't automatically/magically configure them for you.

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron


#7

to create a cronjob:

crontab -u www-data -e

and enter this (check if path is correct first!):

*/15 * * * * php -f /var/www/html/owncloud/cron.php

afterwards activate the cronjob for owncloud:

cd /var/www/html/owncloud && sudo -u www-data php occ background:cron

and yes, the documentation isnt that bad at all, just give it a try :wink:


#8

Okay, I entered the commands above but with my correct path yesterday, but when I looked at it today, the cloud still says: "Cron: Last cron job execution: 16 hours ago."
Did I forget anything?


#9

Hi,

yes, the following:


#10

Nah, as I said, I entered the commands with my correct paths, so I didnt entered them for /var/www/html/owncloud/... but for /var/www/owncloud/...

Also our cloud had some frozes since I tried the cron thing, deleting the new line from the crontab file solved that problem.


#11

Logfiles (see FAQ category) and basic linux knowledge might help to debug this.


#12

Okay so should I just copy'n'paste the logfile in here? (As new users aren't allowed to upload files.)


#13

or use something like pastebin to upload and link it down here.


#14

Okay, uloaded the logfile here, as it is too big for pastebin and stuff.


#15

hmmmm... im not sure about it, but what i can see is:

{"reqId":"BlrR791+OqYQwf\/va8p0","remoteAddr":"78.94.54.180","app":"cron","message":"We are in maintenance mode, skipping cron","level":0,"time":"2016-10-25T11:44:22+00:00","method":"GET","url":"\/cron.php","user":"CloudAdmin"}

are you still on maintenance or singleuser-mode?


#16

Okay, so now I deactivated maintenance mode, and it looks good at first sight.
It says "Cron: Last cron job execution: Just now."
But I'm still getting no emails for the activity notifications.
Sending a test email works, so email server should be configured correctly.


#17

Hi,

please create a new thread about this issue (we shouldn't mix the cron issue with notification issues here) for the reasons explained here:


#18