my_webapp_ynh icon indicating copy to clipboard operation
my_webapp_ynh copied to clipboard

Add ability to add cron jobs

Open CodeShakingSheep opened this issue 5 months ago • 1 comments

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.

CodeShakingSheep avatar Jan 18 '24 16:01 CodeShakingSheep