This article assumes that you have already rhc client installed on your local machine. If it's not, you can read about it here.
Login into openshift and choose your application. Click on "Or, see the entire list of cartridges you can add" link and add Cron cartridge.
$ rhc domain show
and find Git URL line, e.g.:
Git URL: ssh://firstname.lastname@example.org/~/git/myapp.git/
Use only inner part of URL for ssh connection and type:
$ ssh email@example.com
$ mkdir $OPENSHIFT_DATA_DIR/BACKUPS
Than press Ctrl+D to unlink from server.
Go to your application folder on local machine and find for folder .openshift. We will create script which will be run ones per week. You can also use other option from here.
$ cd ~/my-app
Run following commands:
$ mkdir .openshift/cron && cd .openshift/cron
$ mkdir weekly && cd weekly
Now you you need to create bash script for database dumping:
$ vi mysqldump.sh
In file insert the next:
$ sudo chmod +x mysqldump.sh
Then save the file.
$ git add .openshift/cron/weekly/mysqldump.sh
Commit changes and push it to the openshift.
Thats it. To check your script work, you can connect to openshift server via ssh and view all your backups in BACKUPS folder in your data directory.