Adding a cron cartridge to an application

In this recipe, you will learn how to add the cron add-on cartridge to your application. The cron cartridge will write the output of the quota command to a file every hour. The database and other cartridges will be covered later in this book.

Getting ready

To prepare for this recipe, you will need rhc installed on your machine. Also, we will make use of the OpenShift application created in the Creating an OpenShift application using the rhc command-line client recipe.

How to do it…

Perform the following steps to add a cron cartridge to your application:

  1. Open a new command-line terminal and run the following command:
    $ rhc add-cartridge --cartridge cron --app myapp
    
  2. Create a new file quota.txt in the application ...

Get OpenShift Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.