Nextcloud TrueNAS Cron settings

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here```
Some or all of the below information will be requested if it isn't supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 19.01
Operating system and version (eg, Ubuntu 20.04): BSD 12.1 (TrueNAS Beta2)
Apache or nginx version (eg, Apache 2.4.25): ?
PHP version (eg, 7.1): 7.4.8

The issue you are facing:
I’ve recently installed the Nextcloud plugin on my TrueNAS 12.1 Beta2 and I’m having a difficult time trying to set up the cron settings for Nextcloud. Using the terminal, I’ve added the following to crontab

crontab -u www-data -e

and added the following lines

*/5 * * * * /usr/local/bin/php -f /usr/local/www.nextcloud/cron.php

From there I verified that the job was scheduled by typing

crontab -u www -l

where I received the following

*/5 * * * * /usr/local/bin/php -f /usr/local/www.nextcloud/cron.php

However, when I go to check the status in my Nextcloud instance I’m notifed that the

I’ve tried running the cron job manually by executing the following code in the Nextcloud jail terminal

#su -m www /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

Unfortunately when I run that command the terminal appears to lock up and not do anything. If I pull up top I can’t see any specific process tied to that command.

Am I doing something wrong, or does anyone have any further troubleshooting/tips that I can try? Thanks in advance!

Update:
I tried making the cron.php executible (chmod 720), and now I’m receiving the following errors.

root@Nextcloud:/usr/local/www/nextcloud # chmod 720 cron.php
root@Nextcloud:/usr/local/www/nextcloud # ls -la cron*
-rwx-w----  1 www   www  5140 Jul 15 13:22 cron.php
root@Nextcloud:/usr/local/www/nextcloud # su -m www /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php
^?ELF^B^A^A: Command not found.
Too many )'s.
root@Nextcloud:/usr/local/www/nextcloud #```


Is this the first time you've seen this error? _(Y/N)_: Y

Steps to replicate it:

1. Perform the steps detailed in the issues
2. Do nothing (cron job seems to fail)
3. 

The output of your Nextcloud log in **Admin > Logging**:

<r":"–",“app”:“PHP”,“method”:“GET”,“url”:"/cron.php",“message”:"Allowed memory size of 536870912 bytes exhausted (tr>


Output of cron from '/var/log/cron/'

<r":"–",“app”:“PHP”,“method”:“GET”,“url”:"/cron.php",“message”:“A non-numeric value encountered at usr/local/www/newww/nextcloud/apps/maps/vendor/lsolesen/pel/src/PelIfd.php#611”,“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:79.0 <v:79.0) Gecko/20100101 Firefox/79.0”,“version”:“19.0.1.1”}


The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

will update


The output of your Apache/nginx/system log in `/var/log/____`:

will update

You probably figured this out by now, but the problem is that you have a typo in your crontab line:

/usr/local/www.nextcloud/cron.php

should be

/usr/local/www/nextcloud/cron.php