Configuration
Simple Backup supports configuration through:
- Configuration files (TOML or YAML)
- Environment variables (for overriding credentials)
Configuration Priority
Storage configuration is read from the storage dictionary in each destination. Environment variables are not automatically used - they must be explicitly referenced in the configuration file or passed through the Kubernetes operator.
Configuration Files
Simple Backup can load configuration from a TOML or YAML file. The application automatically looks for:
config.tomlconfig.yamlconfig.yml
Copy one of the example files to get started:
# Using TOML (recommended)
cp config.example.toml config.toml
# Or using YAML
cp config.example.yaml config.yamlMultiple Destinations Configuration
You can backup to multiple storage locations simultaneously:
# config.yaml
source_path: /path/to/backup
compression: tar.zst
retention:
daily: 7
weekly: 4
monthly: 6
destinations:
- service: s3
root: backups/
storage:
bucket: my-primary-bucket
region: us-east-1
access_key_id: AKIAxxxxx
secret_access_key: xxxxx
- service: s3
root: backups/
storage:
bucket: my-secondary-bucket
region: us-west-2
access_key_id: AKIAyyyyy
secret_access_key: yyyyy
- service: azblob
root: backups/
storage:
container: my-backups
account_name: myaccount
account_key: xxxxxOr in TOML:
# config.toml
source_path = "/path/to/backup"
compression = "tar.zst"
[retention]
daily = 7
weekly = 4
monthly = 6
[[destinations]]
service = "s3"
root = "backups/"
[destinations.storage]
bucket = "my-primary-bucket"
region = "us-east-1"
access_key_id = "AKIAxxxxx"
secret_access_key = "xxxxx"
[[destinations]]
service = "s3"
root = "backups/"
[destinations.storage]
bucket = "my-secondary-bucket"
region = "us-west-2"
access_key_id = "AKIAyyyyy"
secret_access_key = "yyyyy"Features:
- Backup to multiple storage backends simultaneously
- Each destination has one storage configuration
- Each destination can use different credentials
- Retention policies apply to each destination independently
- Archive is created once and uploaded to all destinations (efficient)
- Startup validation: Connectivity to all storage backends is tested before backup runs
Note: Credentials should be stored in the storage section of each destination.
Storage Service Configuration
Configure storage credentials directly in the storage section of each destination:
Amazon S3
destinations:
- service: s3
root: backups/
storage:
bucket: my-bucket
region: us-east-1
access_key_id: AKIAIOSFODNN7EXAMPLE
secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
endpoint: https://s3.amazonaws.com # OptionalAzure Blob Storage
destinations:
- service: azblob
root: backups/
storage:
container: my-container
account_name: myaccount
account_key: your-account-keyGoogle Cloud Storage
destinations:
- service: gcs
root: backups/
storage:
bucket: my-bucket
credential: /path/to/service-account.jsonAlibaba Cloud OSS
destinations:
- service: oss
root: backups/
storage:
bucket: my-bucket
endpoint: https://oss-cn-hangzhou.aliyuncs.com
access_key_id: your-access-key
access_key_secret: your-secretHuawei Cloud OBS
destinations:
- service: obs
root: backups/
storage:
bucket: my-bucket
endpoint: https://obs.region.myhuaweicloud.com
access_key_id: your-access-key
secret_access_key: your-secret-keyTencent Cloud COS
destinations:
- service: cos
root: backups/
storage:
bucket: my-bucket
region: ap-guangzhou
secret_id: your-secret-id
secret_key: your-secret-keyWebDAV
destinations:
- service: webdav
root: backups/
storage:
endpoint: https://webdav.example.com
username: your-username
password: your-passwordLocal Filesystem
destinations:
- service: fs
root: /path/to/backup/destination
storage:
root: /path/to/backup/destinationBest Practices
- Configuration Method: Use config files for base configuration and structure.
- Security: Never commit credentials to version control. Use Kubernetes Secrets or other secret management tools to inject credentials into the
storagesection. - Naming: Use descriptive
archive_namevalues to easily identify backups. - Destination Root: Use the
rootfield in each destination to organize backups by date or purpose (e.g.,backups/2025/01/). - Compression: Choose compression based on your needs (see Compression Guide).
- Validation: Ensure destination paths exist and are writable. Simple Backup validates connectivity on startup by creating a test file (
.simple-backup-test) in each destination. If validation fails, the backup will not proceed.
Example Configurations
Basic Configuration with Credentials
# config.toml
source_path = "/data"
compression = "tar.zst"
[[destinations]]
service = "s3"
root = "backups/"
[destinations.storage]
bucket = "my-backup-bucket"
region = "us-east-1"
access_key_id = "AKIAxxxxx"
secret_access_key = "xxxxx"Using Kubernetes Secrets
When using the Kubernetes operator, credentials are automatically injected from the BackupJob CR:
apiVersion: backup.reonokiy.com/v1
kind: BackupJob
metadata:
name: my-backup
spec:
source:
pvcName: my-data
subPath: /data
destination:
service: s3
bucket: my-backup-bucket
region: us-east-1
accessKeyId: AKIAIOSFODNN7EXAMPLE
secretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
schedule: "0 2 * * *"
compression: tar.zstThe operator automatically converts these fields to the appropriate storage configuration for the backup container.