Setting up a cron job through an app

Hello fellow Nextcloud devs.

I am new to nextcloud development and might need help to understand some basic concepts.
I am currently developing an app that gets the list of all installed nextcloud apps and sends it to our api regularly through a cron job. After reading through the cron configuration docs, i choose a different way while developing and managed to execute the cron process through docker compose. Many of our customers that will use the app are not developers, i.e they can not configure nextcloud to set up the cron job by themselves, and we need the app to do it automatically.

My question is, how can i set up a cron job that will work without needing the user to do extra configurations? Is there any hook i can use to set up the cron process ?

Thank you for your help :pray:

The NC core has a cronjob pre-insatlled that triggers a regular PHP script. See the corresponding documentation on how to register a corn job in PHP.

1 Like