syseleven / resticpy

Minimal Python wrapper around the restic backup command-line interface.

Home Page:https://mtlynch.github.io/resticpy/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

resticpy

PyPI CircleCI Coverage Status License

Overview

Minimal Python wrapper around the restic backup command-line interface.

Installation

From pip

pip install resticpy

From source

git clone https://github.com/mtlynch/resticpy.git
cd resticpy
pip install .

Quick start

Create a password file

printf "mysecretpass" > password.txt

Initialize a repository and back up a file

import restic

restic.repository = '/tmp/backup1'
restic.password_file = 'password.txt'

restic.init()
restic.backup(paths=['some-file.txt'])

Restore a snapshot

import restic

restic.repository = '/tmp/backup1'
restic.password_file = 'password.txt'

restic.restore(snapshot_id='latest', target_dir='~/restored')

API Documentation

https://mtlynch.github.io/resticpy/

Example

I personally use this library for my backups. I've published my backup script at mtlynch/mtlynch-backup.

Compatibility

resticpy is tested against restic 0.15.0.

Acknowledgments

This project is forked from jstzwj/PyRestic.

About

Minimal Python wrapper around the restic backup command-line interface.

https://mtlynch.github.io/resticpy/

License:MIT License


Languages

Language:Python 97.0%Language:Shell 3.0%