Cron in nextcloud Scale Cobia Beta.1

duderuud

Dabbler
Joined
Jul 2, 2022
Messages
43
I gave up after trying both the Truecharts and TrueNAS versions multiple times. I just created a VM which works flawlessly.
 
Joined
Dec 20, 2023
Messages
2
@Shigure
I suggest you to run this inside truenas cron jobs. And configure nextcloud to use cron. This will fetch the right pod and container and run the cron inside. You have to set your truenas cron to execute like */5 Minutes.
Code:
NEXTCLOUDPOD=$(k3s kubectl get -o wide -n ix-nextcloud --field-selector=status.phase==Running pods | grep 'nextcloud-[0-9]' | awk '{ print $1; }'); k3s kubectl exec -n ix-nextcloud -c nextcloud -i "$NEXTCLOUDPOD" -- su -s /bin/bash www-data -c 'php -d memory_limit=-1 -f /var/www/html/cron.php'


To run something from the occ commands inside the container you can use the same command from your zsh and just alter the COMMAND after occ part:

Code:
NEXTCLOUDPOD=$(k3s kubectl get -o wide -n ix-nextcloud --field-selector=status.phase==Running pods | grep 'nextcloud-[0-9]' | awk '{ print $1; }'); k3s kubectl exec -n ix-nextcloud -c nextcloud -i "$NEXTCLOUDPOD" -- su -s /bin/bash www-data -c 'php -d memory_limit=-1 occ COMMAND'
 

sstruke

Dabbler
Joined
Feb 2, 2017
Messages
37
@Shigure
I suggest you to run this inside truenas cron jobs. And configure nextcloud to use cron. This will fetch the right pod and container and run the cron inside. You have to set your truenas cron to execute like */5 Minutes.
Code:
NEXTCLOUDPOD=$(k3s kubectl get -o wide -n ix-nextcloud --field-selector=status.phase==Running pods | grep 'nextcloud-[0-9]' | awk '{ print $1; }'); k3s kubectl exec -n ix-nextcloud -c nextcloud -i "$NEXTCLOUDPOD" -- su -s /bin/bash www-data -c 'php -d memory_limit=-1 -f /var/www/html/cron.php'


To run something from the occ commands inside the container you can use the same command from your zsh and just alter the COMMAND after occ part:

Code:
NEXTCLOUDPOD=$(k3s kubectl get -o wide -n ix-nextcloud --field-selector=status.phase==Running pods | grep 'nextcloud-[0-9]' | awk '{ print $1; }'); k3s kubectl exec -n ix-nextcloud -c nextcloud -i "$NEXTCLOUDPOD" -- su -s /bin/bash www-data -c 'php -d memory_limit=-1 occ COMMAND'
I get an error with this code
su: Authentication failure
command terminated with exit code 1
I'm afraid I don't know what password I need
 
Top