A script for Batocera to back up your data to cloud storage using rclone.
It is for uploading user data to cloud storage, so in case of a hardware failure/loss, the data can be easily restored. The script itself cannot restore data, that must be done manually.
It has two modes:
- Automatic: using Batocera's services feature, it periodically uploads your saves in the background.
- Manual: by running the script manually, you can do a full backup of your data.
It's tested and works with Batocera v40 and rclone's OneDrive provider. Other providers very likely work just as well, they just haven't been tested by me. Open an issue if you run into one that doesn't work.
Important
Steam data is currently not backed up by this script. Only the saves handled by Steam are saved outside of Batocera.
Background: since Steam on Batocera is installed using Flatpak, it's data is structured differently than the other systems. All game data, not just saves, is stored in the /userdata/saves/flatpak
directory, which is currently ignored by the script.
No. rclone can upload or download files to/from a cloud storage. This script only does the former. rclone's bidirectional sync feature is currently in beta. As soon as that changes, this script will be most likely updated to take advantage of it. Until then, Syncthing is the best solution for this use case.
Yes. If you'd like to do that, make sure you configure the destDir variable to point to a different directory for each device to avoid collisions. Otherwise they'd overwrite each other's files that are named the same.
- Copy the backup script to your Batocera installation's
/userdata/system/services
directory. - Modify the configuration at the top of the file according to your needs.
- Follow the steps in one of the methods here and set up a remote with the name
backup
. - Enable the service with
batocera-services enable backup
. - Restart Batocera or use
batocera-services start backup
.
Refer to the Batocera wiki to learn how to manage services.
To do a manual backup: bash services/backup manual
This does a full backup including not just saves, but your configuration (batocera.conf
), ROMs and BIOS files. Use this after modifying any of those.
Open this repository in VS Code and install the workspace recommended extensions, so the script can be automatically copied to the Batocera machine on save.
Local dependencies that need to be installed for the copying to work: sshpass
, scp
.