• Stars
    star
    491
  • Rank 89,636 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 12 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bakthat is a MIT licensed backup framework written in Python, it's both a command line tool and a Python module that helps you manage backups on Amazon S3/Glacier and OpenStack Swift. It automatically compress, encrypt (symmetric encryption) and upload your files.

Bakthat

I stopped working on bakthat, I'm now working on another backup-related project: blobstash/blobsnap. If somebody want to be a collaborator and continue development, please open an issue.

Bakthat is a MIT licensed backup framework written in Python, it's both a command line tool and a Python module that helps you manage backups on Amazon S3/Glacier and OpenStack Swift. It automatically compress, encrypt (symmetric encryption) and upload your files.

Here are some features:

  • Compress with tarfile
  • Encrypt with beefish (optional)
  • Upload/download to S3 or Glacier with boto
  • Local backups inventory stored in a SQLite database with peewee
  • Delete older than, and Grandfather-father-son backup rotation supported
  • Possibility to sync backups database between multiple clients via a centralized server
  • Exclude files using .gitignore like file
  • Extendable with plugins

You can restore backups with or without bakthat, you just have to download the backup, decrypt it with Beefish command-line tool and untar it.

Check out the documentation to get started.

Overview

Bakthat command line tool

$ pip install bakthat

$ bakthat configure

$ bakthat backup mydir
Backing up mydir
Password (blank to disable encryption):
Password confirmation:
Compressing...
Encrypting...
Uploading...
Upload completion: 0%
Upload completion: 100%

or

$ cd mydir
$ bakthat backup

$ bakthat show
2013-03-05T19:36:15 s3  3.1 KB  mydir.20130305193615.tgz.enc

$ bakthat restore mydir
Restoring mydir.20130305193615.tgz.enc
Password:
Downloading...
Decrypting...
Uncompressing...

$ bakthat delete mydir.20130305193615.tgz.enc
Deleting mydir.20130305193615.tgz.enc

Bakthat Python API

import logging
import sh
logging.basicConfig(level=logging.INFO)

from bakthat.helper import BakHelper

BACKUP_NAME = "myhost_mysql"
BACKUP_PASSWORD = "mypassword"
MYSQL_USER = "root"
MYSQL_PASSWORD = "mypassword"

with BakHelper(BACKUP_NAME, password=BACKUP_PASSWORD, tags=["mysql"]) as bh:
    sh.mysqldump("-p{0}".format(MYSQL_PASSWORD),
                u=MYSQL_USER,
                all_databases=True,
                _out="dump.sql")
    bh.backup()
    bh.rotate()

Changelog

0.7.0

Not released yet, developed in the develop branch.

  • Incremental backups support, with Incremental-Backups-Tools.
  • Revamped configuration handling
  • Stronger unit tests
  • Plugin architecture improved
  • Switch from aaargh to cliff for the CLI handling

0.6.0

June 5 2013

  • Event hooks handling
  • Support for plugin

0.5.5

May 26 2013

  • Support for excluding files, using .bakthatexclude/.gitignore file, or a custom file.
  • Added support for reduced redundancy when using S3

0.5.4

May 8 2013

  • Better log handling
  • Allow more complex rotation scheme

0.5.3

May 6 2013

  • Bugfix config

0.5.2

May 6 2013

  • new BAKTHAT_PASSWORD environment variable to set password from command line.

0.5.1

May 5 2013

  • New -c/--config argument.
  • New periodic_backups command tied to BakManager API.

0.5.0

April 21 2013

  • New Swift backend, thanks to @yoyama
  • ls command removed in favor of the show command
  • Compression can now be disabled with the compress setting
  • Bugfix default destination

0.4.5

Mars 20 2013

  • bugfix configure (cancel of configure cmd cause empty yml), thanks to @yoyama
  • new bakthat.helper.KeyValue
  • BakSyncer improvement

0.4.4

Mars 10 2013

  • bugfix (forgot to remove a dumptruck import)

0.4.3

Mars 10 2013

  • bakthat show bugfix

0.4.2

Mars 10 2013

  • Using peewee instead of dumptruck, should be Python2.6 compatible again.

0.4.1

Mars 8 2013

  • small bugfix when restoring from glacier
  • bakhelper now support custom configuration and profiles
  • aligned date in show command

0.4.0

If you come from bakthat 0.3.x, you need to run:

$ bakthat upgrade_to_dump_truck

And you also need to run again bakthat configure.

$ cat ~/.bakthat.conf
$ bakthat configure

Changes:

  • The filename is now a positional argument for all command
  • Using DumpTruck instead of shelve
  • Save backups metadata for both backends
  • BakHelper to help build backup scripts
  • BakSyncer to help keep you list sync over a custom REST API
  • Now adding a dot between the original filename and the date component
  • Tags support (-t/--tags argument)
  • Profiles support (-p/--profile argument)
  • New show command, with search support (tags/filename/destination)
  • Hosted documentation

0.3.10

  • bug fix glacier upload

0.3.9

  • small bug fixes (when updating an existing configuration)

0.3.8

  • Added delete_older_than command
  • Added rotate_backups command (Grandfather-father-son backup rotation scheme)

Contributors

  • Eric Chamberlain
  • Darius Braziunas
  • SÅ‚awomir Å»ak
  • Andreyev Dias de Melo
  • Jake McGraw
  • You Yamagata
  • Jordi Funollet

License (MIT)

Copyright (c) 2012 Thomas Sileo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

microblog.pub

A self-hosted, single-user, ActivityPub powered microblog.
Python
1,102
star
2

btcplex

BTCplex is an open source Bitcoin block chain browser written in Go, it allows you to search and navigate the block chain.
Go
104
star
3

blobstash

You personal database. Mirror of https://git.sr.ht/~tsileo/blobstash
Go
102
star
4

little-boxes

Tiny ActivityPub framework written in Python, both database and server agnostic.
Python
82
star
5

dirtools

Exclude/ignore files in a directory (using .gitignore like syntax), compute hash, search projects for an entire directory tree, gzip compression and track changes in a directory over time.
Python
74
star
6

flask-yeoman

A Flask blueprint to make create web application using Yeoman and Flask an easy task.
Python
51
star
7

txwatcher

A little Python utility that lets you monitor Bitcoin addresses through Blockchain Websocket API and perform custom callbacks.
Python
49
star
8

blobsnap

BlobSnap: a snapshot-based backup system designed to provide "time machine" like features.
Go
47
star
9

pycgminer

Python wrapper for cgminer RPC API.
Python
41
star
10

incremental-backups-tools

Storage agnostic incremental backups tools, building blocks for creating incremental backups utilities.
Python
28
star
11

embedded-js-widget

Building an embedded widget using RequireJS and Ractive.js.
CSS
27
star
12

cube-client

A Python client for Cube: Time Series Data Collection & Analysis
Python
26
star
13

eve-mocker

Mocking tool for Eve powered REST API.
Python
21
star
14

camlipy

Unofficial Python client for Camlistore.
C
19
star
15

blobsfile

BlobStash's storage engine. Mirror of https://git.sr.ht/~tsileo/blobsfile
Go
16
star
16

defender

Golang middleware to prevent brute force attacks
Go
16
star
17

entries.pub

WIP IndieWeb blog engine
OCaml
14
star
18

blobfs

New project: https://git.sr.ht/~tsileo/blobfs
Go
12
star
19

indieauth

Implements an IndieAuth (an identity layer on top of OAuth 2.0) client/authentication middleware.
Go
12
star
20

rigsmonitoring

Self-hosted monitoring dashboard for your mining rigs written in Python.
JavaScript
10
star
21

blkparser

Open source Bitcoin block chain parser written in Go.
Go
9
star
22

gluapp

HTTP framework for GopherLua.
Go
9
star
23

poussetaches

Lightweight asynchronous task execution service
Go
9
star
24

objets

Objets is an object storage server (using a directory as backend) with a AWS S3 compatible API.
Go
8
star
25

are-you-tracking-me

Open-source Android application (written in Kotlin) that let you send your GPS location to your own server at a regular interval.
Kotlin
6
star
26

pyblinkm

Drive a BlinkM with Python via I2C using python-smbus on Raspberry Pi.
Python
5
star
27

s3layer

S3 compatibility layer for custom data sources.
Go
3
star
28

ts4

A content-addressed blob store backed by S3, indexed by upload time (in SimpleDB) accessible via a simple HTTP API.
Go
3
star
29

globster

Tools for converting globs to regular expressions.
Python
3
star
30

yammpress

Python
2
star
31

blobs

Blobs mobile app (built with Flutter)
Dart
2
star
32

blobstash-python

Python client for BlobStash. Mirror of https://git.sr.ht/~tsileo/blobstash-python
Python
2
star
33

broxy

The most friendly proxy ever!
Go
2
star
34

rawgeo

Building block for geohash based spatial indexes
Go
2
star
35

jquery-hawk-ajax

A jQuery plugin to use the hawk HTTP authentication scheme with $.ajax
JavaScript
2
star
36

ginette

Ginette is my personal always-on voice assistant powered by Python.
Python
2
star
37

bakthat-syncserver

Draft of a synchronization server for bakthat.
Python
1
star
38

blckchn

(obsolete)
Python
1
star
39

rightnow

Python
1
star
40

misc

Misc stuff that aren't worth a repo.
Lua
1
star
41

wesh

A Bonjour name server for your local network
Python
1
star
42

went-there

Lua application built to run on ge0 that I use to track my locations using Are You Tracking Me?.
Lua
1
star
43

blobpad

BlobPad is a note taking application build on top of BlobStash.
JavaScript
1
star
44

gemapi

Gemapi is a lightweight Gemini framework.
Python
1
star