my_webapp_ynh
my_webapp_ynh copied to clipboard
Add ability to add cron jobs
I would like to be able to add a predefined cron file during installation or in the config panel. The idea is that the user provides the cron content upon installation or in the config panel, such as
59 23 28-31 * * my_webapp curl ${{APP_URL}}/api/cron/monthlyDigestEmail -X POST -H 'content-type: application/json' -H 'authorization: ${{CRON_API_KEY}}' --fail
*/15 * * * * my_webapp curl ${{APP_URL}}/api/cron/workflows/scheduleEmailReminders -X POST -H 'content-type: application/json' -H 'authorization: ${{CRON_API_KEY}}' -sSf
Then the app automatically creates a file for it in /etc/cron.d
with respective permissions.