To complete the need of running jobs/tasks on a particular schedule, using PCF tasks scheduler, this recipe outlines the steps to successfully provision a job.
Scheduler for PCFis installed on the platform
Scheduler for PCFis installed. If not already, install
cf install-plugin C\path\to\scheduler-for-pcf-cliplugin-windows64-exe
To prevent the application from starting up immediately, set the instance count to zero in the manifest file. In addition, the buildpacks should be set to binary_buildpack. Lastly, ensure the command attribute is set. Take notice of the stack when setting the command. In the example below, the windows stack defaults to the classic batch command.
applications: - name: ((appname)) buildpacks: - binary_buildpack instances: 0 health-check-type: process stack: windows command: cmd /c .\MyApp.exe path: bin/release
cf push -f .\manifest.yml --var appname=my-app
Example, create a job called
my-job from a cf app called
cf create-job my-app my-job "MyApp"
my-job to run every 5 minutes
`cf schedule-job my-job "*/5 * ? * * "`