cloud-foundrypcfdev

scheduler for PCF for .NET console application


I have created a simple HelloWorld .NET core 2.0 console application. I want to schedule it to run every 5 minutes using scheduler for PCF service.

The steps I followed are:

  1. deployed the HelloWorld app to PCF using 'cf push' command
  2. Selected "Scheduler for PCF" service in MarketPlace in PCF console.
  3. I gave the scheduler a name and bound it to the HelloWorld app in PCF console
  4. Then I am struggling to create a job $ cf create-job HelloWorld my-job COMMAND

But I am not sure what i should pass for COMMAND argument of create-job.

If I succeed in creating the job and then I will cron it using the following command:

  1. $ cf schedule-job my-job "5 * * * * "

Please help me in this regard. Please let me know, if you need further details.

Thanks in advance.


Solution

    1. The app should be in app stage.
    2. Please ensure you have installed the latest plug in from pivotal n/w.
    3. cf Create-job <<AppName>><<job-name>> "dotnet <<AppassemblyName>>.dll "<<Parameters to the console application>>""
    4. cf schedule-job <<job-name from previous steps>> "*/5 * ? * *"

    This link helped be a lot https://starkandwayne.com/blog/schedule-containers-in-pivotal-cloud-foundry/