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:
Open a new command-line terminal and run the following command:
$ rhc add-cartridge --cartridge cron --app myapp
Create a new file
quota.txt
in the application root directory and populate it with the following code. On a *nix machine, you can use thecat
command, as shown in the following command line:$ echo "# Quote File" >> quota.txt
On Windows machines, you can use filesystem explorer to create...