Code Monkey home page Code Monkey logo

prestic's Introduction

Pete's Restic

Lets you define and run restic commands from a YAML file.

Features:

  • YAML allows reuse of repository definitions and command line flags with YAML anchors and aliases
  • Automatically set --parent flag to snapshot ID of the last backup

prestic's People

Contributors

pitaylor avatar

Watchers

 avatar

prestic's Issues

Add integration tests

Add integration tests using bats or the like.

Things to test:

  1. restic commands run successfully
  2. restic failures cause non-zero exit
  3. AutoParent feature
  4. Stdin command
  5. Stdin command failure

Command ordering is arbitrary

Ideally it would execute the commands in order as defined in the config file, but right now it's arbitrary (maybe because go maps aren't insertion ordered). This means prune and forgets could run before backups.

Suggestions:

  1. Order commands as defined in config file
  2. Order backups first, then forgets and prunes

Run as recurring launchd task

The idea is to run prestic install-launchd on macOS to install prestic as a launchd task that runs on a recurring schedule. Similar to anacron launchd can handle computer sleeps better than cron.

Support .d style configuration fragments

It might be useful to maintain pieces of the prestic configuration in separate files in /etc/prestic.d, for example on systems where applications may install their own config.

Add shell command that populates env vars

Add a command like the following:

prestic shell my_backup

...that spawns a sub-shell with env vars pre-loaded from the specified command. It could also populate special env vars with command flags and arguments. The idea is to make it easy to poke around a repo with restic commands. This of course requires the config use environment variables in preference to CLI flags, although it could try to be fancy and convert flags to env vars where possible.

# In the shell, can maybe use special env vars to re-create the command
restic "${PRESTIC_FLAGS}" "${PRESTIC_ARGS}"

# or perhaps create an aliased command that includes the flags
restic_with_flags "${PRESTIC_ARGS}"

Improve logging

Ideas:

  • Add log levels
  • Restic output goes to DEBUG
  • Restic commands go to DEBUG (may show passwords)
  • Log command name and execution time to INFO
  • Log to prestic.log?
  • Log to syslog?

Take a look at logrus

Better implementation for autoparent

Some potential downsides to the state file for tracking snapshot IDs:

  1. prestic doesn't currently manage locking/concurrency for updating this file
  2. adds complexity

So far it's only used for the autoparent option. Could we lookup the snapshot ID by tag instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.