How to run cronjobs with Application


Anuj Jain <anuj17280@...>
 

Hi,


We have an application (lets say django app) - which we deployed on
Cloud Foundry - now there are few commands which we want to run
periodically (cron jobs) - what is the best way to handle this with Cloud
Foundry.



Thanks

- Anuj


Nicholas Calugar
 

Hi Anuj,

For scheduling, you might want to look into the Advanced Python Scheduler
[1]. You would push the scheduler as a separate app to Cloud Foundry.

You could also experiment with V3 Tasks that we are close to releasing. You
can think of Tasks as commands to run against your app code that only take
up resources while executing. As of CF-245, you can push an application and
then run a task against it. There’s currently only support via curl [2],
but we are working on supporting this via CLI.


[1] http://apscheduler.readthedocs.io/en/3.0/
[2]
http://v3-apidocs.cloudfoundry.org/version/release-candidate/#push-v2-app-and-run-a-v3-task


Thanks,

Nick

--
Nicholas Calugar

On October 18, 2016 at 8:03:38 AM, Anuj Jain (anuj17280(a)gmail.com) wrote:

Hi,


We have an application (lets say django app) - which we deployed on
Cloud Foundry - now there are few commands which we want to run
periodically (cron jobs) - what is the best way to handle this with Cloud
Foundry.



Thanks

- Anuj


Anuj Jain <anuj17280@...>
 

Thanks Nick I will try it

On 19 Oct 2016 8:21 a.m., "Nicholas Calugar" <ncalugar(a)pivotal.io> wrote:

Hi Anuj,

For scheduling, you might want to look into the Advanced Python Scheduler
[1]. You would push the scheduler as a separate app to Cloud Foundry.

You could also experiment with V3 Tasks that we are close to releasing.
You can think of Tasks as commands to run against your app code that only
take up resources while executing. As of CF-245, you can push an
application and then run a task against it. There’s currently only support
via curl [2], but we are working on supporting this via CLI.


[1] http://apscheduler.readthedocs.io/en/3.0/
[2] http://v3-apidocs.cloudfoundry.org/version/release-candidate/#push-v2-
app-and-run-a-v3-task


Thanks,

Nick

--
Nicholas Calugar

On October 18, 2016 at 8:03:38 AM, Anuj Jain (anuj17280(a)gmail.com) wrote:

Hi,


We have an application (lets say django app) - which we deployed on
Cloud Foundry - now there are few commands which we want to run
periodically (cron jobs) - what is the best way to handle this with Cloud
Foundry.



Thanks

- Anuj