Nextcloud version: 20.0.5
Operating system and version: Docker
Nginx vesion: 1.20.2
PHP version: 8.0.25
The issue you are facing:
Just looking for advice on how to run a shell script one time when Nextcloud has finsihed it’s startup function, I don’t want to run it under cron as it only needs to run the once and the Nextcloud Background Tasks documentation doesn’t explain this very well.
I think there is no startup function. What time do you mean? Normally the webserver is up and running and then happens … nothing … until cron or someone executes a php script from Nextcloud.
When your Linux uses sytemd (like Ubuntu does), this could be your friend:
This is an example, not your ready to copy&paste solution!
Think of a good catchy name for your job and put it in lowercase in place of the YOURONETIME placeholder:
Create this file /etc/systemd/system/YOURONETIME.service
In the place of “//DESCRIPTION OF YOURONETYME JOB//” add a brief description of what your script does. User and Group is only necessary if the script should not be run as root.
try around, in which configuration your script starts at the right time and if the required services are loaded. You can even make a combination of all your required services like this: