Giter VIP home page Giter VIP logo

restic-wrapper-b2's Introduction

Restic wrappers for system backup to Backblaze B2

Manifest

README.md    - this file

bin/         - Restic binary dir.
cache/       - Local repo cache dir.
conf/b2-id   - Backblaze B2 Application Key ID.
conf/b2-key  - Backblaze B2 Application Key.
conf/dirs    - List of paths to back up.
conf/exclude - List of paths to exclude from backups.
conf/pass    - Restic repository password.
conf/repo    - Restic repository name.
conf/version - Version of restic binary to use.

backup.sh    - Run a backup and prune existing backups.
check.sh     - Verify existing backups.
wrapper.sh   - Convenience wrapper; reads configuration and fetches/runs
               restic binary appropriate for the current arch and OS.

crontab      - Example crontab to run backup.sh and check.sh.

Setup

Clone this repo

git clone https://github.com/smammy/restic-wrapper /opt/restic

Set up your Restic repo

/opt/restic-wrapper-b2/wrapper.sh init

Add configuration

cd /opt/restic/conf

touch b2-key pass
chmod 600 b2-key pass

echo "b2:your-b2-bucket-name:" > repo
echo "your restic repo password" > pass
echo "your b2 app key id" > b2-id
echo "your b2 app key" > b2-key
echo "/" > dirs
echo <<'EOT' > exclude
/home/*/.cache
/tmp
/var/cache
/var/tmp
EOT

Test connection

/opt/restic-wrapper-b2/wrapper.sh stats

Test backup

/opt/restic-wrapper-b2/backup.sh

Test repo check

/opt/restic-wrapper-b2/check.sh

Install crontab

cp crontab /etc/cron.d/restic

Maybe change the hour, minute, and day-of-month values in the crontab too.

Generating a restore bundle

A restore bundle contains all the files necessary to restore from the configured restic repo.

( umask 077 && sudo tar -C /opt/ -cvJf- --exclude-caches --exclude bin restic-wrapper-b2 > restic-bundle-for-$HOSTNAME.tar.xz )

WARNING: this bundle will contain your B2 credentials and repo password! You should probably encrypt it.

restic-wrapper-b2's People

Contributors

smammy avatar

Watchers

 avatar  avatar  avatar

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.