Coder Social home page Coder Social logo

chriscummins / emu Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 902 KB

Fast, incremental, rotating backups

Home Page: http://chriscummins.cc/posts/emu-by-example

License: GNU General Public License v3.0

Shell 9.73% Python 81.30% Makefile 0.15% CSS 5.37% HTML 3.45%
backup-solution rsync-backups backup-manager backup-script rotating-snapshots backup-utility backup linux

emu's Introduction

emu - Fast, incremental rotating backups

Build Status Coverage Status PyPi Status Python Version License Badge

Emu is a command line backup tool, inspired by git and Time Machine. It is:

  • Fast: The battle tested, optimized rsync perform the heavy lifting of transferring files.
  • Incremental: Hardlinks minimize the overhead of storing multiple backups when few files change.
  • Rotating: All backups are kept within the past day, daily backups are kept for the past month, weekly backups are kept for previous months. The oldest backups are removed to make space for the newest.

Additionally, emu is:

  • Transparent: There are no proprietary formats or data blobs. Backups are files; metadata is plaintext.
  • Accessible: Use your favorite file manager to browse old backups, or use the Python API for more control.
  • Simple: The core operations are simple: It creates new backups, it deletes old backups as required. One line in your crontab is all it takes for peace of mind.

Installation

Requires Python >= 3.6.

$ pip install emu

After installation, we recommend running the test suite to ensure everything is in tip-top working order:

$ emu test

License

Copyright © 2012-2020 Chris Cummins.

Released under the terms of the GPLv3 license. See COPYING for details.

emu's People

Contributors

chriscummins avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

emu's Issues

C-c during emu verify causes an IndexError

$ emu verify -S /mnt/primary
^Cemu: received SIGINT
Traceback (most recent call last):
  File "/usr/local/bin/emu-verify", line 63, in <module>
    ret = main(argv, len(argv))
  File "/usr/local/bin/emu-verify", line 52, in main
    use_cached=options.use_cached):
  File "/usr/local/libexec/emu/libemu.py", line 602, in verify
    clean = worker_thread.get() == self.id.checksum
  File "/usr/local/libexec/emu/libemu.py", line 2485, in get
    return stdout.split()[0][:32]
IndexError: list index out of range
$ emu version
emu version 0.1.50

Add emu-monitor

usage: emu monitor 4000. launches a web server on port 4000 which provides a visual log of backups

Mac OS X compatability issues

 ./scripts/run-tests.sh                                              19:30:49
    clean/deadlink PASS
    clean/in-progress PASS
    clean/lock PASS
    clean/orphans FAIL
    init/init PASS
    init/permissions PASS
    init/quiet PASS
    init/reinitialize PASS
    init/template PASS
    init/update PASS
    log/limit FAIL
    log/log PASS
    log/no-sink PASS
    log/push FAIL
    log/sinks FAIL
    log/summary FAIL
    push/dry-run PASS
    push/excludes FAIL
    push/max FAIL
    push/message FAIL
    push/no-sink FAIL
    push/push FAIL
    sink/add PASS
    sink/rm PASS
    sink/sink FAIL
    verify/hash FAIL
    verify/invalid-hash FAIL
    verify/sink-hash FAIL

14 passed, 14 failed
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1
head: illegal line count -- -1

A log file of failed tests can be found at 'test.log'

run-tests: Doesn't report skipped tests on interrupt

If you cancel running the tests early, you don't get any notification that some tests were missed. Example:

$ ./scripts/run-tests.sh 
    clean/deadlink PASS
    clean/debug PASS
    clean/in-progress PASS
    clean/lock PASS
    clean/orphans ^C
All 4 tests passed

Prune the feature bloat

Features to remove:

  • the squash command
  • the HEAD pointer, and anything to do with branching
  • checkout - replace it with a 'restore' command
  • most of the command line flags. they should either go in .emu/config, or be hardcoded
  • the explicit clean command - this should be done automatically on push

Implement an io module

Interface:

enable_verbose_messages()
disable_verbose_messages()
verbose(*args, **kwargs)

enable_debug_messages()
disable_debug_messages()
debug(*args, **kwargs)

enable_warning_messages()
disable_warning_messages()
warning(*args, **kwargs)

error(*args, **kwargs)

fatal(*args, **kwargs)

emu stack causes uncaught TypeError

$ emu sink -v
Traceback (most recent call last):
  File "/usr/local/bin/emu-sink", line 128, in <module>
    ret = main(argv, len(argv))
  File "/usr/local/bin/emu-sink", line 49, in main
    Util.readable(options.source_dir, error=True)
  File "/usr/local/libexec/emu/libemu.py", line 1502, in readable
    Util.exists(path, error=error)
  File "/usr/local/libexec/emu/libemu.py", line 1481, in exists
    exists = os.path.exists(path)
  File "/usr/lib/python2.7/genericpath.py", line 18, in exists
    os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
$ emu --version
emu version 0.1.51

Add `emu status` command

$ emu status
New snapshot in progress, started 12 hours ago
$ emu status
Last snapshot 2017-06-14-113212 created 3 days ago
$ emu status --seconds
0  # if snapshot in progress
$ emu status --seconds
189  # if last snapshot 3 minutes old

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.