Skip to main content
Upload rules are an optional part of a release. They define which files on your devices get uploaded to your bucket. This page covers defining upload rules and including them when creating a release. While a release must contain at least one config schema, it may contain any number of upload rules, including none. For the full release-creation workflow — config schemas, Git metadata, and the CLI command — see the Create a release guide.

Prerequisites

Upload rules write files to a bucket, so a connected bucket is required. Connect one before creating a release with upload rules: The generic prerequisites are covered in the Create a release guide.

Define the upload rules

Upload rules are defined as YAML files in your Git repository. Below is an example rule that uploads all log files from the /var/log/robot directory to the my-uploads-bucket bucket.
robot-logs.yaml
Like schemas, upload rules are identified by hashing their content, so rules with equivalent content are deduplicated even if their comments or formatting differ.

Source

A rule’s source declares what to collect on the device: which files to match, and when a matching file is considered finished and eligible for upload.
glob
string
required
An absolute glob pattern that selects the files to upload.Must satisfy the following criteria:
  • Absolute — it starts with /
  • At most 1024 bytes, with no control characters
  • No .. segments, and no empty segments (// or a trailing /)
You must grant the Miru Agent read access to the files you want to upload. Visit the file system access section for more details.
Example: /var/log/robot/*.log
stability_window_secs
integer
default:"60"
How long, in seconds, a matching file’s size and modification time must stay unchanged (quiescent) before it is considered stable and eligible for upload. See completion detection.

Destination

A rule’s destination declares where which registered bucket to write to, and the object path within it.
bucket
string
Name of the registered bucket this rule uploads to.Example: my-uploads-bucket
path
string
The template which defines the object path to which the uploaded file is written.The following variables are supported, which are filled in when each upload’s object key is rendered:
Templates must contain the {upload_id} variable.
delete_policy
enum
default:"never"
When the device deletes the local source file after collecting it.
  • never (default) — keep the local file in place; you manage local retention yourself.
  • after_upload — delete the local file once the upload is durably confirmed.

Add upload rules to a release

Upload rules ride along with miru release create — the same command that creates the release and its schemas. Include them with either flag (both may be repeated):
  • --upload-rule <file> — a single upload rule YAML file
  • --upload-rules <dir> — a directory of upload rule YAML files
See the CLI reference for the full flag list.
Last modified on July 21, 2026