RepositoryOptions configures how rustic accesses and interacts with a repository, including caching, warm-up strategies, and performance tuning.
Type Definition
Fields
no_cache
Disable the local cache entirely. When
true, rustic will not cache any repository data locally, which may significantly impact performance but reduces disk usage.RUSTIC_NO_CACHE
cache_dir
Custom cache directory path. If not set, rustic uses the platform’s standard cache location. Conflicts with
no_cache.RUSTIC_CACHE_DIR
warm_up
Enable automatic warm-up of data pack files. When
true, rustic requests pack files without processing them to trigger caching in cloud storage systems or similar.- Cold storage backends (e.g., AWS S3 Glacier)
- CDN or cache-based storage systems
- Improving restore performance
warm_up_command
External command to execute for warming up pack files. The command string should include
%id as a placeholder for the pack ID.warm_up.
Example:
warm_up_wait_command
Command to execute and wait for before considering warm-up complete. Also uses
%id placeholder.warm_up_wait
Duration to wait after warm-up completes. Useful when storage systems need time to move data from cold to hot tier.
warm_up_batch
Number of pack IDs to batch together when invoking warm-up commands. Higher values reduce the number of command invocations but may exceed command-line length limits.
Builder Methods
Thanks to theSetters derive macro, RepositoryOptions provides fluent builder methods:
Self for method chaining.
Usage Examples
Basic Usage
Disable Cache
Custom Cache Directory
Enable Warm-Up
Cold Storage Configuration
For AWS S3 Glacier or similar cold storage:Hot/Cold Repository Setup
Command-Line Integration
With theclap feature enabled, RepositoryOptions can be parsed from command-line arguments:
--no-cache- Disable cache--cache-dir <PATH>- Set cache directory--warm-up- Enable warm-up--warm-up-command <CMD>- Set warm-up command--warm-up-wait-command <CMD>- Set warm-up wait command--warm-up-wait <DURATION>- Set warm-up wait duration--warm-up-batch <SIZE>- Set warm-up batch size
Configuration File
With themerge feature, options can be loaded from configuration files:
Performance Considerations
Cache Impact
- With cache (default): Faster repeated access, uses local disk space
- Without cache (
no_cache = true): Slower, no local disk usage - Custom cache: Useful for controlling cache location (e.g., SSD vs HDD)
Warm-Up Strategies
Simple warm-up (warm_up = true):
- Requests files without processing
- Good for CDN/cache systems
- Custom logic per storage system
- Batch processing reduces overhead
- Allows storage tier migration
- Essential for cold storage (Glacier, Archive tier)
Best Practices
-
Use defaults for local storage:
-
Disable cache for single-use operations:
-
Configure warm-up for cloud storage:
-
Use custom cache for performance tuning:
See Also
- Repository - Main repository type
- BackendOptions - Backend configuration
- ConfigFile - Repository-level configuration