The script provides a convenient way to load environment config, deal
with profiles and act as a pass-through to restic. The overall thing is
to improve the UX when running restic, integrating the features this
project provides.
## Note
The script itself is a very simple thing.
The command line parser is auto-generated using docopt.sh driven from
the script's DOC. It can be refreshed upon DOC changes with:
`docopt.sh path/to/resticw`.
## How to use it
### Examples
```console
sudo resticw stats latest
sudo resticw -p profileA snapshots
```
### Help
```console
❯ resticw --help
A little wrapper over restic just to handle profiles and environment loading.
It loads the backup profile/environment in a subshell to avoid any credential leak (Note: Run it with sudo so it can load the environment).
Usage:
resticw [options] <restic_arguments>
The restic_arguments is just the regular unwrapped restic arguments, e.g. stats latest
Options:
-p --profile=<name> Specify the profile to load or use default [default: default].
Examples:
sudo resticw --profile profileA snapshots
sudo resticw stats latest # this will use the profile: default
```
Co-authored-by: Erik Westrup <erik.westrup@gmail.com>
3.0 KiB
3.0 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Added
resticwwrapper for working with different profiles without the need to source the profiles first.
[4.0.0] - 2022-02-01
Fixed
- Use arrays to build up command lines. When fixing
shellcheck(1)errors, quotes would disable expansion on e.g. $RESTIC_BACKUP_PATHS- BREAKING CHANGE
RESTIC_BACKUP_PATHSis now a string with:separated values
- BREAKING CHANGE
[3.0.1] - 2022-02-01
Fixed
- Environment variable assertion should allow empty values e.g.
RESTIC_BACKUP_EXTRA_ARGS
[3.0.0] - 2022-02-01
Added
- Allow extra arguments to restic-backup with
$RESTIC_BACKUP_EXTRA_ARGS. - Add
$RESTIC_VERBOSITY_LEVELfor debugging. - Assertion on all needed environment variables in the backup and check scripts.
- Added linter (
shellcheck(1)) that is run on push and PRs.
Changed
- BREAKING CHANGE renamed
/etc/restic/backup_excludeto/etc/restic/backup_exclude.txt<backup-dest>/.backup_excludeto<backup-dest>/.backup_exclude.txt.
- BREAKING CHANGE renamed envvars for consistency
BACKUP_PATHS->RESTIC_BACKUP_PATHSBACKUP_TAG->RESTIC_BACKUP_TAGRETENTION_DAYS->RESTIC_RETENTION_DAYSRETENTION_WEEKS->RESTIC_RETENTION_WEEKSRETENTION_MONTHS->RESTIC_RETENTION_MONTHSRETENTION_YEARS->RESTIC_RETENTION_YEARS
- Align terminology used in README with the one used by B2 for credentials (keyId + applicationKey pair).
[2.0.0] - 2022-02-01
Changed
- BREAKING CHANGE #45: multiple backup profiles are now supported. Please backup your configuration before upgrading. The setup of configuration files are now laied out differently. See the README.md TL;DR setup section.
restic_backup.shhas had variables extracted to profiles instead, to allow for configuration of different backups on the same system.b2_env.shis split to two files_global.envanddefault.env(the default profile)._global.envwill have B2 accountID and accountKey anddefault.envhas backup paths, and retention.b2_pw.shrenamed to pw.txt
Fixed
restic_backup.shnow finds.backup_excludefiles on each backup path as intended.
[1.0.1] - 2021-12-03
Fixed
- $(make install) now works for the *.template files (#40)
[1.0.0] - 2021-12-02
It's time to call this a proper major version!
Added
uninstalltarget forMakefile- Add
--prunetorestic-forget - README badges and updates.
Fixed
backup_excludedestination- Conflicts for restic-check service
[0.1.0] - 2019-07-23
- First tagged version to allow Arch's AUR to download a tarball archive to install.