Chapter 2. Managed Files
$cartridge_name/metadata/managed_files.yml file lists managed files and strings that OpenShift Enterprise uses during different stages of the cartridge life cycle.
Most entries in the managed_files.yml file use file patterns. OpenShift Enterprise treats these patterns like shell globs. Dir.glob processes entries that contain asterisk (*) symbols using the File::FNM_DOTMATCH flag. It treats entries that end in a forward slash (/) as directories, and other entries as files. For more information on globs, see http://ruby-doc.org/core-1.9.3/Dir.html#method-c-glob.
~/ start at the gear directory. All other entries start at the cartridge directory.
Some entries allow string values. These values return directly without any modification.
OpenShift Enterprise supports the following entries:
Table 2.1. Managed File Entries
| Entry | Type | Usage | Reference |
|---|---|---|---|
| locked_files | File Pattern | Files that the application developer can read but not update. | Chapter 3, Locking Cartridges |
| snapshot_exclusions | File Pattern | Array of file names not to backup from the gear when rhc snapshot runs. | Chapter 10, Backing Up and Restoring Cartridges |
| setup_rewritten | File Pattern | Files that OpenShift Enterprise removes before running setup. | Section 6.2, “setup Script” |
| process_templates | File Pattern | ERB templates OpenShift Enterprise renders after running setup. | Section 6.1, “Embedded Ruby (ERB) Processing” |
| restore_transforms | Strings | Set of regex transforms for rewriting file names when rhc restore runs. | Chapter 10, Backing Up and Restoring Cartridges |
managed_files.yml file:
Example 2.1. managed_files.yml
locked_files:
- env/
- ~/.foorc
snapshot_exclusions:
- mydir/*
restore_transforms:
- s|${OPENSHIFT_GEAR_NAME}/data|app-root/data|
process_templates:
- **/*.erb
setup_rewritten:
- conf/*

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.