TrueNAS Scale Nextcloud cron not working

frankyvee

Cadet
Joined
Mar 8, 2023
Messages
6
Thanks for all the input. I installed NextCloud and then inputted the data above for the cronjob, but can only achieve the schedule of Every 5 Minutes. So unless there is more specific input, I'll have to keep messing with it. I did try and test it out to enable cron schedule after installing the app, and got the following error message.

I'll keep trying out different schedules. I've also noticed that if I do try and "edit" the installation of NextCloud, then the app seems to be stuck in deploying 1/2. Any thoughts there from anyone? What i've done in the past is delete that NextCloud instance and re download. But I'm hoping doing that over and over doesn't ruin anything in the short term.
I just noticed your second question. I experienced that as well. What I did to install a clean installation to make sure there were no remnants of the previous installation files of Next Cloud was to delete the dataset that NextCloud was on. Then recreate the dataset in Truenas for it and start the installation from the beginning. Hope this helps.
 

TYFLOOZY

Dabbler
Joined
Mar 25, 2023
Messages
30
I have looked at Nexcloud setttings, CRON is selected.

I did figure out the deploying issue, I had accidently messed up on the dataset (I had one Home Assistant drive mapped to nexcloud and i forget whatever else) and so I deleted and created a new data set.

So I still need to figure out the cronjob schedule issue and now ran into an issue where i tried updating Nextcloud on Truenas and now NC is stuck in Maintenance Mode. If there are any recommended threads on that, it would be appreciated.
 

TYFLOOZY

Dabbler
Joined
Mar 25, 2023
Messages
30
I have looked at Nexcloud setttings, CRON is selected.

I did figure out the deploying issue, I had accidently messed up on the dataset (I had one Home Assistant drive mapped to nexcloud and i forget whatever else) and so I deleted and created a new data set.

So I still need to figure out the cronjob schedule issue and now ran into an issue where i tried updating Nextcloud on Truenas and now NC is stuck in Maintenance Mode. If there are any recommended threads on that, it would be appreciated.

Never mind on the maintenance mode, got it figured out.
 

TYFLOOZY

Dabbler
Joined
Mar 25, 2023
Messages
30
I just noticed your second question. I experienced that as well. What I did to install a clean installation to make sure there were no remnants of the previous installation files of Next Cloud was to delete the dataset that NextCloud was on. Then recreate the dataset in Truenas for it and start the installation from the beginning. Hope this helps.
So I started fresh, deleted nexcloud and the dataset, as well as updated Nextcloud and TrueNAS and the overall install seemed a bit better since I was trying to connect Collabora. I still can't get CRON to work though, i've used all sorts of commands and tried a few schedules but stuck to the */5**** pretty consistently.

Do I need to go into the NextCloud shell to figure out the specific cron command for my system? Everyone seems to be able to get it to work with different commands. And if there is a way to figure out what my special command would be, how do I find that? I've been on youtube, this forum, Lawrence tech forum and Nextcloud forums and can't seem to get it, this is my first time trying to set up a cron.
 

demuxer86

Cadet
Joined
May 24, 2023
Messages
3
I have the same issue. Truenas scale fully up to date. Nextcloud official app fresh install (twice)... no matter what I do, I cannot get cron jobs to work. I tried the scripts in this thread too... just nothing works :/
 

demuxer86

Cadet
Joined
May 24, 2023
Messages
3
Nevermind, i got it! I had to change the container name in the script, but I thought i needed the k8s at the beginning.

I used (in truenas shell)

docker ps | grep nextcloud

found my container name, which was nextcloud_testcloud and so the cron script is

docker exec --user www-data `docker ps | grep "nextcloud_testnextcloud" | awk '{ print $1; }'` php /var/www/html/cron.php

This works now!!
 

demuxer86

Cadet
Joined
May 24, 2023
Messages
3
Oops, wrong script. Can't edit messages???

Anyway, the script i used was

docker exec --user www-data `docker ps | grep "nextcloud_testcloud" | awk '{ print $1; }'` php /var/www/html/cron.php
 

TYFLOOZY

Dabbler
Joined
Mar 25, 2023
Messages
30
So it seems like this section here - "nextcloud_testcloud" - is specific to your truenas instance, right?. How did you figure out what phrase to use in the parenthesis? Is this the name that is used on the application or the name that is used for the dataset or something else?

Also this can still be done in the GUI as well, right? The shell is great, I'm just not as familiar or just confident in using the shell and end up breaking things.
 

Isma

Contributor
Joined
Apr 29, 2020
Messages
100
good, I tried all the possible combinations in my case, but my nextcloud data is in another set of disks, this being the address

Nextcloud Storage
Nextcloud Data Volume
/mnt/Raidz2/nextclouddata/

Postgres Data Volume
/mnt/SSD/nextclouddata/1

try
docker exec --user www-data `docker ps | grep "nextcloud_nextcloud" | awk '{ print $1; }'` php /var/www/html/cron.php
docker exec --user www-data `docker ps | grep "k8s_nextcloud_nextcloud" | awk '{ print $1; }'` php /var/www/html/cron.php

And changing all the urls that point to cron.php
******| awk '{ print $1; }'` php /mnt/Raidz2/nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /Raidz2/nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /html/cron.php
******| awk '{ print $1; }'` php /cron.php
etc

At the moment I configure webcron and I use the recommended app from https://www.easycron.com/ pointing directly to url/cron.php and it works for me


any ideas to configure cron?
 

Attachments

  • Sin título.png
    Sin título.png
    24.5 KB · Views: 127

Isma

Contributor
Joined
Apr 29, 2020
Messages
100
good, I tried all the possible combinations in my case, but my nextcloud data is in another set of disks, this being the address

Nextcloud Storage
Nextcloud Data Volume
/mnt/Raidz2/nextclouddata/

Postgres Data Volume
/mnt/SSD/nextclouddata/1

try
docker exec --user www-data `docker ps | grep "nextcloud_nextcloud" | awk '{ print $1; }'` php /var/www/html/cron.php
docker exec --user www-data `docker ps | grep "k8s_nextcloud_nextcloud" | awk '{ print $1; }'` php /var/www/html/cron.php

And changing all the urls that point to cron.php
******| awk '{ print $1; }'` php /mnt/Raidz2/nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /Raidz2/nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /nextclouddata/html/cron.php
******| awk '{ print $1; }'` php /html/cron.php
******| awk '{ print $1; }'` php /cron.php
etc

At the moment I configure webcron and I use the recommended app from https://www.easycron.com/ pointing directly to url/cron.php and it works for me


any ideas to configure cron?


the problem in my case was the user of the command
with me it works like this

docker exec --user root `docker ps | grep "nextcloud_nextcloud" | awk '{ print $1; }'` php cron.php
 

o_minchev

Cadet
Joined
Oct 29, 2020
Messages
1
After trying to run in shell, I received:

root@truenas-scale:~$ docker ps
-bash: docker: command not found

Help, please.
 

aherbjornsen

Dabbler
Joined
Dec 7, 2014
Messages
15
After trying to run in shell, I received:

root@truenas-scale:~$ docker ps
-bash: docker: command not found
Docker was removed in Cobia. See this thread for solution:
 

Dave41

Dabbler
Joined
Sep 20, 2022
Messages
17
Cron entry in the Nexcloud setup beat me up pretty badly, Kept getting this message:

middlewared.service_exception.CallError: [EFAULT] Failed to update App: Error: UPGRADE FAILED: failed to create resource: CronJob.batch "nextcloud-cronjob" is invalid: spec.schedule: Invalid value: "*/15****": expected exactly 5 fields, found 1: [*/15****]

SOLUTION: The proper format is */15 * * * * the five entries need a SPACE between them.
 
Top