Git Product home page Git Product logo

anarcat / bup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bup/bup

0.0 0.0 0.0 3.99 MB

Very efficient backup system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). Current release is 0.25, and the development branch is master. Please post patches to the mailing list for discussion (see below).

License: Other

Emacs Lisp 0.05% Python 74.85% Shell 16.62% Perl 0.72% C 7.71% CSS 0.04%

bup's People

Contributors

0-wiz-0 avatar aidanhs avatar alexbarton avatar aneurin avatar apenwarr avatar davidcroda avatar dcoombs avatar edmonds avatar elsabio avatar jbeda avatar jcristau avatar jmtd avatar kumanna avatar lelutin avatar leto avatar lkosewsk avatar maw avatar mbudde avatar mfwitten avatar pfrouleau avatar phord avatar pmccurdy avatar posativ avatar rlbdv avatar shanerg avatar takeshitakenji avatar thatch avatar ucko avatar yungchin avatar zoranzaric avatar

Watchers

 avatar  avatar  avatar

bup's Issues

stdout/stderr handling is quirky

the way that bup handles stdout/stderr is a little exotic. it seems to reopen file descriptors under certain circumstances.

this makes it difficult to make subcommands that want to process logging or handle those file descriptors differently. for example, i worked on a wrapper for index/save that redirects stdout to /dev/null (if not verbose) and stderr to a file for logging.

this yields various errors in the logs:

close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr

now this may be a bug in python itself: http://bugs.python.org/issue11380

but it's unclear to me while those file descriptors are being messed with.

bup index -x / /foo skips /foo if /foo is a separate filesystem

23:42 <wrouesnel> -x is --one-file-system
23:42 <wrouesnel> so / /var would correctly determine that /var is shadowed by / and remove it
23:43 <@rlb> wrouesnel: ahh -- I suppose that makes some sense -- what about "index /var /"?
23:43 <@rlb> with -x?
23:43 <wrouesnel> it would do the same - the path reduction happens independent of -x
23:43 <wrouesnel> that's definitely a bug.
23:44 <@rlb> if nothing else, we should make sure the behavior is well documented -- whatever it does, and whatever we mean for it to do.
23:44 <wrouesnel> so reduce_paths needs to know about the -x flag, and check that any it wants to remove are on the same filesystem
23:44 <@rlb> I suppose I would have expected "-x / /var" to include both, but not cross any boundaries underneath them.

sys.stdout.flush() crashes when closed

if bup is called somewhat with a weird stdout, for example if redirected to /dev/null (iirc), it will crash with:

19:31 <anarcat>     sys.stdout.flush()
19:31 <anarcat> IOError: [Errno 9] Bad file descriptor
19:31 <anarcat>   File "/usr/lib/bup/cmd/bup-index", line 89, in update_index

this is of course related to #2.

here's a workaround:

diff --git a/cmd/index-cmd.py b/cmd/index-cmd.py
index b7fe8f1..3eedb31 100755
--- a/cmd/index-cmd.py
+++ b/cmd/index-cmd.py
@@ -87,7 +87,11 @@ def hashgen(name):
                                                  exclude_rxs=exclude_rxs):
         if opt.verbose>=2 or (opt.verbose==1 and stat.S_ISDIR(pst.st_mode)):
             sys.stdout.write('%s\n' % path)
-            sys.stdout.flush()
+            try:
+                sys.stdout.flush()
+            except IOError:
+               # probably stdout is closed, ignore
+               pass
             elapsed = time.time() - index_start
             paths_per_sec = total / elapsed if elapsed else 0
             qprogress('Indexing: %d (%d paths/s)\r' % (total, paths_per_sec))

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.