Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schedule CronJobs with the PHP Buildpack

For my PHP Web App I am using the PHP Buildpack. Now I would like to schedule a Tasks that should be triggered every month. Normally I would use CronJobs for that. How can I achieve that within the Swisscom Application Cloud?

like image 830
Nattha K Avatar asked Jan 19 '26 03:01

Nattha K


1 Answers

Swisscom App Cloud is based on Open Source Cloud Foundry

Upstream Cloud Foundry doesn’t have a feature equivalent to cron jobs (task scheduler). Stay tuned, I guess this feature will be soon implemented, because lots of people migrating from Heroku to CF. Heroku offers a cron job feature. Subscribe to Swisscom App Cloud Newsletter to read announcements.

There are workarounds for scheduling tasks, see Scheduling tasks on Cloud Foundry on blog.pivotal.io for a Ruby/Rake based example. Sorry for PHP I didn't found example code. There is no elegant solution! You need to implement yourself some kind of workaround. Would be great if you publish your code to GitHub.

If you need cron jobs only in data store, for example MariaDB offers Events.

Events are named database objects containing SQL statements that are to be executed at a later stage, either once off, or at regular intervals.

They function very similarly to the Windows Task Scheduler or Unix cron jobs.

like image 128
Josefine Avatar answered Jan 20 '26 21:01

Josefine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!