Backend Setup
This guide covers how to set up and configure different storage backends for rustic_core, including local storage, cloud storage (S3), REST servers, and rclone.Overview
rustic_core supports multiple backend types:- Local - Store repository on local filesystem
- S3 - Amazon S3 and S3-compatible storage
- REST - REST server (rustic-server or restic-server)
- Rclone - Any storage supported by rclone
- OpenDAL - Multiple cloud providers via OpenDAL
Local Backend
Store repositories on local or network-attached filesystems.use rustic_backend::BackendOptions;
use rustic_core::{Repository, RepositoryOptions};
let backends = BackendOptions::default()
.repository("/path/to/repo")
.to_backends()?;
let repo = Repository::new(&RepositoryOptions::default(), &backends)?;
let backends = BackendOptions::default()
.repository("/path/to/repo")
.options(vec![
("post-create-command".to_string(),
"echo 'Created: %file (type=%type, id=%id)'".to_string()),
("post-delete-command".to_string(),
"echo 'Deleted: %file'".to_string()),
])
.to_backends()?;
// Absolute path
let backends = BackendOptions::default()
.repository("/backup/repo")
.to_backends()?;
// Relative path (relative to current directory)
let backends = BackendOptions::default()
.repository("./local-repo")
.to_backends()?;
// Home directory
let backends = BackendOptions::default()
.repository("~/backups/repo")
.to_backends()?;
S3 Backend
Use Amazon S3 or S3-compatible storage (MinIO, Wasabi, etc.).AWS S3
S3-Compatible Storage
S3 Authentication
Set credentials via environment variables:S3 Options
REST Backend
Connect to a REST server (rustic-server or restic-server).Basic REST Setup
REST Authentication
Authentication via environment variables:REST with TLS Client Certificates
REST Options
Rclone Backend
Use rclone to access any storage backend supported by rclone.Basic Rclone Setup
Common Rclone Remotes
Rclone Configuration
First configure rclone:Rclone Options
OpenDAL Backends
Access multiple cloud providers via OpenDAL.Supported OpenDAL Services
Hot/Cold Backend Setup
Combine fast (hot) and slow (cold) storage for optimal performance.Local + S3 Hot/Cold
How Hot/Cold Works
- Tree packs (metadata) → Hot storage (fast access)
- Data packs (file contents) → Cold storage (cheaper)
- Automatic synchronization between hot and cold
Hot/Cold Configuration
Backend Comparison
Performance Characteristics
| Backend | Speed | Cost | Reliability | Use Case |
|---|---|---|---|---|
| Local | Fastest | Low | Medium | Fast backups, local storage |
| S3 | Fast | Medium | High | Cloud backups, durability |
| REST | Medium | Low | Medium | Self-hosted, network storage |
| Rclone | Varies | Varies | Varies | Flexibility, cloud providers |
Backend Selection Guide
Choose Local when:- Backing up to external drives
- Using NAS or network storage
- Need fastest possible performance
- Need cloud storage with high durability
- Want automatic replication
- Require compliance/audit features
- Self-hosting backup server
- Need HTTP-based access
- Want to use rustic-server
- Using cloud storage not directly supported
- Need encryption in transit
- Want flexibility to change providers
Common Backend Configurations
Encrypted Cloud Backup
Multi-Location Backup
Hybrid Hot/Cold Setup
Backend Best Practices
Security
Reliability
Performance
Troubleshooting
Connection Issues
Credential Problems
Performance Issues
See Also
- Configuration Guide - Repository configuration
- Backup Guide - Using configured backends
- Repository Management - Maintenance operations
- BackendOptions API Reference