NextCloud Cron-Job isn‘t working.

benalbi

Cadet
Joined
Apr 10, 2022
Messages
3
Hello everyone!

I want to enable the Cron-Job for nextcloud background activities, but unfortunately I can't get it to work...
I thought this command is going to work:

Code:
sudo -u www-data k3s kubectl exec -n ix-nextcloud --stdin --tty nextcloud-66c598859-6vklm -- php -f cron.php


Which returned:

Defaulted container "nextcloud" out of: nextcloud, init-postgresdb (init)

Code:
Console has to be executed with the user that owns the file config/config.php

Current user id: 0

Owner id of config.php: 33

command terminated with exit code 1


Then looked up, which user am i for the container:

Code:
sudo -u www-data k3s kubectl exec -n ix-nextcloud --stdin --tty nextcloud-66c598859-6vklm -- whoami 

Which returned:

Code:
Defaulted container "nextcloud" out of: nextcloud, init-postgresdb (init)

root 


So now i know, that i need to change the user for the container to "www-data", but how is this possible?
I would greatly appreciate any help!
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
I'd check if you can change those commands to run "su -l -c '<command here>" www-data" inside the container, I.E. as part of the "k3s kubectl exec command".
 

benalbi

Cadet
Joined
Apr 10, 2022
Messages
3
I'd check if you can change those commands to run "su -l -c '<command here>" www-data" inside the container, I.E. as part of the "k3s kubectl exec command".
Here is the output:

Code:
root@truenas[/]# k3s kubectl exec -n ix-nextcloud --stdin --tty nextcloud-66c598859-6vklm -- su -l -c 'php -f cron.php' www-data

Defaulted container "nextcloud" out of: nextcloud, init-postgresdb (init)
This account is currently not available.
command terminated with exit code 1
 

gorrunyo

Dabbler
Joined
Sep 12, 2022
Messages
17
Here is the output:

Code:
root@truenas[/]# k3s kubectl exec -n ix-nextcloud --stdin --tty nextcloud-66c598859-6vklm -- su -l -c 'php -f cron.php' www-data

Defaulted container "nextcloud" out of: nextcloud, init-postgresdb (init)
This account is currently not available.
command terminated with exit code 1
Did yo manage to execute this?
 
Top