btrestic
btrestic is a wrapper for using restic on a btrfs filesystem. For all configured subvolumes it creates read-only snapshots, backs them up with restic, and removes the snapshots afterwards.
Usage
Show help:
btrestic --help
Available commands:
backup— Run backup for all configured subvolumesrestic [args...]— Run restic with configured environmentexec [args...]— Run arbitrary command with configured environmentversion— Print the version
You can specify a config file with -c or --config_file:
btrestic backup -c /path/to/btrestic.conf
Configuration File
The configuration file is a YAML file that controls how btrestic operates. Below is an example configuration:
:snapshot_dir: /mnt/btrfs/restic-snapshots
:subvolumes:
- /mnt/btrfs/@home
- /mnt/btrfs/@music
- /mnt/btrfs/@videos
- /mnt/btrfs/@pictures
:excludes:
- /mnt/btrfs/@home/my_user/.cache
:env:
AWS_ACCESS_KEY_ID: aws-access-key-id```
AWS_SECRET_ACCESS_KEY: super-secret-aws-key
RESTIC_PASSWORD: super-secret-restic-password
RESTIC_REPOSITORY: s3:s3.wasabisys.com/my-bucket
:logging:
logfile: /var/log/btrestic.log
loglevel: warn
Configuration Options
:snapshot_dir: Directory where temporary btrfs snapshots are created.:subvolumes: List of btrfs subvolumes to back up.:excludes: List of paths to exclude from the backup.:env: Environment variables for restic (such as repository, credentials, password, etc).:logging: Logging configuration:logfile: Path to the log file.loglevel: Log verbosity (debug,info,warn,error).
You can use the provided btrestic.conf.example as a template for your own configuration.
Contributing
- Fork it (https://gitlab.com/dilli/btrestic/forks/new)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Daniel Illi - creator and maintainer