Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

replace custom wrapper scripts with runrestic #57

Open
paulfantom opened this issue May 19, 2019 · 5 comments
Open

replace custom wrapper scripts with runrestic #57

paulfantom opened this issue May 19, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@paulfantom
Copy link
Owner

paulfantom commented May 19, 2019

This role shouldn't reinvent the wheel and implement custom scripts for various restic functionalities. There are already many projects providing a simple to use wrapper on restic and those could be used instead.

We could use runrestic which is written in python3 and available via pip3 install runrestic. Personally I like this one as it has clear configuration and includes instrumentation to push metrics to prometheus monitoring system.

This is only an idea, but implementing this should greatly simplify second day operations and reduce role maintenance.

@paulfantom
Copy link
Owner Author

Going this path means that all bash/cron scripts should be removed from this repository and replaced with simple invocations of runrestic (or other software).

@kalos
Copy link

kalos commented May 19, 2019

I think is a clever idea.
I'm using a simple wrapper in bash, but something more flexible as runrestic is really appreciated.

@davdr
Copy link

davdr commented Sep 6, 2019

Have you considered a separate role for installing restic itself, and (an)other role(s) for the wrapper(s)?

@paulfantom
Copy link
Owner Author

@davdr that's a good idea, I didn't consider it.

@darkdragon-001
Copy link

darkdragon-001 commented May 25, 2020

Have you considered a separate role for installing restic itself, and (an)other role(s) for the wrapper(s)?

Maybe just allow setting the command prefix. This would allow switching between different restic installations (e.g. package manager, docker, ...).

In my currently manual script, I am using something like:

# restic.sh
source "vars.sh"
RESTIC_LOCAL='eval restic --cache-dir "$WORKDIR/cache"'
RESTIC_DOCKER='eval docker run --rm -t
  -v $WORKDIR/cache:/restic_cache
  -v /home/$USER:/restic_data:ro -w /restic_data
  -e RESTIC_REPOSITORY
  -e RESTIC_PASSWORD
  -e AWS_ACCESS_KEY_ID
  -e AWS_SECRET_ACCESS_KEY
  restic/restic
  --cache-dir /restic_cache'
RESTIC="$RESTIC_LOCAL"  # change this to RESTIC_DOCKER if you like
$RESTIC "$@"

So one can just run ./restic.sh backup --one-file-system .. It is work in progress, so adapting the docker mount when changing paths needs to be done of course, but I think you get the idea

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants