Restic-companion - a wrapper around restic w/ some added functionnality

Hi there,

I have been using restic within my team for about one year now, in several contexts: server backup, workstation backup, my own pc, etc. Restic is a great tool, however I think it’s a bit too power-user-ish. I’m not talking about the lack of an UI. But rather by the fact to use it effectively in production => probably a lot of users have scripts around restic.

I’d like to generalize the scripts that we are using, and to publish this as a project that may be reused by others. I have the name “restic-companion” in mind.

The features that our “wrapper” script will have:

  • gather the output and send it to healthchecks.io; enabling though robust email notifications in case of failure + log of the executions
  • lvm snapshot
  • periodic command that checks the health of the backup. I saw that the restic docs mention it quite a lot. So my understanding is that a production use should periodically run it.
  • prune logic, e.g. to keep only a specified amound of backups. E.g. 1 month, etc.

2 questions:

  1. are you aware of such initiatives? If yes, it would be interesting to take a look to see if we cannot reuse the existing work
  2. do you have any comments on our initiative? Do you have remarks that could help?

PS: we use “node js” for scripting, to have win-linux compatibility.

Regards,
Cristian

One reason I like restic is its flexibility, which allows these so-called wrapper scripts to be created. I myself don’t see any reason to use any third party component/script/program in addition to the backup program (restic) itself since backups are a really critical component of any production system and the more unknown scripts/programs are involved the higher of risk of failing backups and/or need to troubleshoot problems related with that script.

I checked that on one of the production servers I’m currently running restic on, has a ~30 line (with plenty of white-space for readability) of shell script wrapper written by me and it’s simple and easy to understand.

Thanks for your input. It’s a perfectly valid point of view.

For me, on the other side, with various systems that need to be backed up, with various people that write these “wrappers”, some of them still in the company, some of them not: it’s a risk not to “uniformize”, and have only one code base + properly versioned.

In the past we started with a few VMs. But “life” happened, and we ended up w/ tens of VMs, with various versions of … everything. That’s why we try now to “uniformize” things now. Now we use a lot “salt stack” and kubernetes, trying to achieve having a central repo of “system software = scripts” that is propagated across all our infrastructure.

Totally understood that it would be good to have same thing everywhere within your company. However, I have a suspicion that it’s too complex to create a generic wrapper script to handle everyone’s needs. There might not be LVM in use, nor does everyone want to mess around with NodeJS. healthchecks.io is also something, which one might not want to use - why not just send out e-mails directly from cron when Linux/Unix is used? Maybe even Linux/Unix/Windows is not in use? What about all the different backup storage options? I’m afraid that this list might go on and there’s always something specific for each system/company so that creating a script, which handles all these edge-cases will become either too complex or even impossible (okay, nothing is impossible when there’s enough time and money) to create. Safer bet would be to create your own to handle your specific needs or don’t create anything when simple restic execution is enough.

Valid points, which are part of the associated challenge.

I’ll start working (I hope) on this next week. Let’s see how I can properly “externalize” settings, while giving access to the full “configurability” of restic. Normally I have this reflex, being a developer working w/ OOP, Java, TypeScript.