Hi there.Having issues with background cron job in Nextcloud.
I´ve tried different examples from other posts in forums. But since the last upgrades to 29.xx its not working.
The page “general settings” in NC has a warning “some jobs have not been executet since a month…”
In TrueNas system settings → advanced → cron jobs I´ve tried:
(App name is nextcloud7)
k3s kubectl exec -n ix-nextcloud7 --stdin --tty “$(/usr/local/bin/k3s kubectl -n ix-nextcloud7 get pods --field-selector status.phase=Running -o name | cut -f2 -d’/')” – su -s /bin/bash www-data -c ‘php occ maintenance:mode --on’
If i run manually the message is :
“Job nextcloud cronjob Completed Successfully”
But i get an email with:
“Error from server (NotFound): pods “nextcloud7-postgres-68c95bcb6c-9r7b4\nnextcloud7-redis-746dcd467f-k752r\nnextcloud7-685ddcc769-zc9zg\nnextcloud7-nginx-5b9664df5-x96wf” not found”
I´m aware “php occ maintenance:mode --on” is not the correct command to be executed.
So the error message above shows that an extra “n” is added to the pod name. why?
Need help to get the cron command correct.
- why yhe extra “n”
- how to format command to execute cron instead of “occ maintenance:mode”
Pod names:
Hardware:
CPU(s):
4 x Intel(R) Xeon(R) CPU E5-1603 v3 @ 2.80GHz (1 Socket)
Kernel Version:
Linux 6.5.13-5-pve (2024-04-05T11:03Z)
Proxmox:
Manager Version
pve-manager/8.1.11/cb1653fdade58a8b
Truenas Scale vm:
TrueNAS-SCALE-23.10.2
2 cores, 15 GB RAM
Datasets:
ncappdata
Owner:
www-data
Read | Write | Execute
Group:
www-data
Read | Execute
ncdbdata
Owner:
netdata
Read | Write | Execute
Group:
docker
None
ncuserdata
Owner:
www-data
Read | Write | Execute
Group:
www-data
Read | Write | Execute
Apps:
Name:
traefik
App Version:
2.11.2
Chart Version:
27.0.14
Name:
cloudflared
App Version:
2024.4.1
Chart Version:
11.0.5
Name:
nextcloud:
App Version:
29.0.2
Chart Version:
2.0.9
Name:
cert-manager
App Version:
latest
Chart Version:
5.0.4
Name:
clusterissuer
App Version:
latest
Chart Version:
8.0.12
Name:
collabora
App Version:
24.04.4.1.1
Chart Version:
2.0.17
Name:
prometheus-operator
App Version:
latest
Chart Version:
7.0.4