summaryrefslogtreecommitdiff
path: root/obnam
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2008-11-30 03:57:47 +0200
committerLars Wirzenius <liw@liw.fi>2008-11-30 03:57:47 +0200
commitea35af585c62cc731a11ee35558188c24737df64 (patch)
tree3b2a7ac3896769dddb6a4edeb84b7d12432206a6 /obnam
parentceb4d5e817d8f92e87de802f1fdc98a62350c5f4 (diff)
downloadobnam-ea35af585c62cc731a11ee35558188c24737df64.tar.gz
Remove stuff that will be rewritten.
Diffstat (limited to 'obnam')
-rwxr-xr-xobnam84
1 files changed, 0 insertions, 84 deletions
diff --git a/obnam b/obnam
deleted file mode 100755
index 443c2125..00000000
--- a/obnam
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2006, 2007, 2008 Lars Wirzenius <liw@iki.fi>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
-"""A backup program"""
-
-
-import logging
-import sys
-import traceback
-
-import obnamlib
-
-
-def main():
- try:
- context = obnamlib.context.Context()
- args = obnamlib.config.parse_options(context.config, sys.argv[1:])
- context.map.max = context.config.getint("backup", "max-mappings")
- context.contmap.max = context.config.getint("backup", "max-mappings")
- context.cache = obnamlib.cache.Cache(context.config)
- context.be = obnamlib.backend.init(context.config, context.cache)
- context.be.set_progress_reporter(context.progress)
- app = obnamlib.Application(context)
-
- obnamlib.log.setup(context.config)
-
- logging.info("%s %s starting up" % (obnamlib.NAME, obnamlib.VERSION))
-
- try:
- factory = obnamlib.OperationFactory(app)
- oper = factory.get_operation(args)
- oper.do_it(args[1:])
-
- logging.info("Store I/O: %d kB read, %d kB written" %
- (context.be.get_bytes_read() / 1024,
- context.be.get_bytes_written() / 1024))
- logging.info("Obnam finishing")
- context.progress.final_report()
- if app.get_store():
- app.get_store().close()
- except KeyboardInterrupt:
- logging.warning("Obnam interrupted by Control-C, aborting.")
- logging.warning("Note that backup has not been completed.")
- sys.stderr.write("Obnam interrupted by Control-C, aborting.\n")
- sys.stderr.write("Note that backup has not been completed.\n")
- if app.get_store():
- app.get_store().close()
- sys.exit(1)
- except obnamlib.ObnamException, e:
- logging.error("%s" % str(e))
- sys.stderr.write("%s\n" % str(e))
- if app.get_store():
- app.get_store().close()
- sys.exit(1)
- except SystemExit:
- sys.exit(1)
- except BaseException, e:
- logging.error("%s" % repr(e))
- logging.error("%s" % traceback.format_exc())
- sys.stderr.write("%s\n" % repr(e))
- sys.stderr.write("%s\n" % traceback.format_exc())
- if app.get_store():
- app.get_store().close()
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()