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
Source
A rule’ssource declares what to collect on the device: which files to match, and
when a matching file is considered finished and eligible for upload.
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/)
/var/log/robot/*.logHow 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’sdestination declares where which registered bucket to write to, and the object path within it.
Name of the registered bucket this rule uploads to.Example:
my-uploads-bucketThe 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:
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 withmiru 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

