Skip to main content
File rules are an optional part of a release. They define which files on your devices Miru manages — where they are uploaded, how long they are kept, or both. This page covers defining file rules and including them when creating a release. While a release must contain at least one config schema, it may contain any number of file rules, including none. For the full release-creation workflow — config schemas, Git metadata, and the CLI command — see the Create a release guide.

Prerequisites

A rule that uploads writes files to a bucket, so a connected bucket is required for it. Connect one before creating a release with rules that upload: A retention-only rule — one with no upload block — does not upload anything, so it needs no bucket. The generic prerequisites are covered in the Create a release guide.

Define the file rules

File rules are defined as YAML files in your Git repository. Below is an example rule that uploads the .log files directly inside the /var/log/robot directory (not its subdirectories) to the my-uploads-bucket bucket, and then deletes each local copy a week after its upload is confirmed.
robot-logs.yaml
Both upload and retention are optional and independent. A rule with only retention uploads nothing and simply reclaims disk on the device:
scratch-cleanup.yaml
For a complete specification of available fields and settings, see the rule definition page. For rules that upload files, you can bundle related files together under one logical unit. Bundles are identified by a file rule’s captures and are only shared within a given device: uploads from different devices are never bundled together. To illustrate bundling, consider the following rule which specifies the {recording} capture in source.glob and uses it in upload.bundle to bundle together all files from a single recording.
Using this rule, all files in the run_42 folder are bundled together:
data
recordings
run_42
camera.mcap
metadata.yaml
run_43
camera.mcap
metadata.yaml
Files in another folder, such as run_43, land in a different bundle.
File rules with the upload.bundle field require CLI v0.12.2 or later.
For more detailed information and advanced bundling examples, see the upload bundles page.

Add file rules to a release

To include file rules in a release, use the --file-rule or --file-rules flags when running the miru release create command.
See the CLI reference for the full flag list.
Last modified on November 13, 2026