# Never lose robot data again: automatic ROS 2 bag recording and upload

DevFeed: [Never lose robot data again: automatic ROS 2 bag recording and upload](<https://devfeed.tech/articles/never-lose-robot-data-again-automatic-ros-2-bag-recording-and-upload-117621.md>)

Original publisher: [Read original article](<https://ubuntu.com//blog/never-lose-robot-data-again-automatic-ros-2-bag-recording-and-upload>)

Author: gbeuzeboc

Published: 2026-11-03T16:02:04Z

Content type: tutorial

Language: en

Sources: [Ubuntu blog](<https://devfeed.tech/sources/ubuntu-blog.md>)

Topics: [recording](<https://devfeed.tech/topics/recording.md>), [snap](<https://devfeed.tech/topics/snap.md>)

Tags: [automatic](<https://devfeed.tech/tags/automatic.md>), [automatically](<https://devfeed.tech/tags/automatically.md>), [aws](<https://devfeed.tech/tags/aws.md>), [aws-s3](<https://devfeed.tech/tags/aws-s3.md>), [backends](<https://devfeed.tech/tags/backends.md>), [bags](<https://devfeed.tech/tags/bags.md>), [central](<https://devfeed.tech/tags/central.md>), [ceph](<https://devfeed.tech/tags/ceph.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [command](<https://devfeed.tech/tags/command.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [content](<https://devfeed.tech/tags/content.md>), [fleet](<https://devfeed.tech/tags/fleet.md>), [recording](<https://devfeed.tech/tags/recording.md>), [robot](<https://devfeed.tech/tags/robot.md>), [robots](<https://devfeed.tech/tags/robots.md>), [ros](<https://devfeed.tech/tags/ros.md>), [ros-2](<https://devfeed.tech/tags/ros-2.md>), [storage](<https://devfeed.tech/tags/storage.md>), [upload](<https://devfeed.tech/tags/upload.md>)

## AI overview

The `ros2-exporter-agent` snap automates ROS 2 bag capture and upload: it records topics to MCAP files, splits bags by time or size, tries to sync them every two minutes through rclone, restarts recording daily, and deletes local files older than 10 minutes. Recording starts only after auto-clean is running, and sync retries if the server is briefly unreachable, leaving bags on the robot only as a short staging buffer. Uploads use an rclone remote named `bagstore`, which can alias an SFTP server or S3-compatible storage; the article says rclone supports more than 40 backends. Setup requires `rclone.conf` and `rosbag2-recorder.yaml` for storage and recording choices. For fleets, a configuration snap can distribute shared settings and updates, with an example that generates a device UID. Suggested extensions include copying bags with rclone, browsing them via a file browser, or opening remote MCAP files in Foxglove.

## Source excerpt

If you work with robots, perhaps you've come up against a common, but annoying situation: the one field run that mattered is the one nobody recorded. Or it was recorded but the ROS 2 bag (a recording of ROS 2 topics) is sitting in the robot's storage, at a customer site, three time zones away. [...]