YunoHost-Apps / my_webapp_ynh

Custom Web app with SFTP access
GNU General Public License v3.0
47 stars 39 forks source link

Add ability to add cron jobs #134

Open CodeShakingSheep opened 5 months ago

CodeShakingSheep commented 5 months ago

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.

alexAubin commented 5 months ago

Hmf this feels outside of the scope of what this app is intended for :|