diff options
author | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-12-22 19:25:06 +0000 |
---|---|---|
committer | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2008-12-22 19:25:06 +0000 |
commit | 4a631e0ba92c7a7aea25dfeb36f645b55c51e856 (patch) | |
tree | 87c00f1ee731d9137c0cba52a01be1bfc96750fe /rdiff-backup/rdiff_backup/Main.py | |
parent | b6acdc2cbf49c3578e8d959f15cc25c201990260 (diff) | |
download | rdiff-backup-4a631e0ba92c7a7aea25dfeb36f645b55c51e856.tar.gz |
Print a more helpful message if we get an error while attempting to read
an old current_mirror marker.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@980 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/Main.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index e8e964b..d4aa48a 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -424,7 +424,10 @@ def fix_failed_initial_backup(): def backup_set_rbdir(rpin, rpout): """Initialize data dir and logging""" global incdir - incdir = Globals.rbdir.append_path("increments") + try: + incdir = Globals.rbdir.append_path("increments") + except (OSError, IOError), exc: + Log.FatalError("Could not begin backup due to\n%s" % exc) assert rpout.lstat(), (rpout.path, rpout.lstat()) if rpout.isdir() and not rpout.listdir(): # rpout is empty dir @@ -543,7 +546,11 @@ def Restore(src_rp, dest_rp, restore_as_of = None): Log.FatalError("Could not find rdiff-backup repository at " + src_rp.path) restore_check_paths(src_rp, dest_rp, restore_as_of) - dest_rp.conn.fs_abilities.restore_set_globals(dest_rp) + try: + dest_rp.conn.fs_abilities.restore_set_globals(dest_rp) + except (OSError, IOError), exc: + print "\n" + Log.FatalError("Could not begin backup due to\n%s" % exc) init_user_group_mapping(dest_rp.conn) src_rp = restore_init_quoting(src_rp) restore_check_backup_dir(restore_root, src_rp, restore_as_of) @@ -710,7 +717,7 @@ def require_root_set(rp, read_only): try: Globals.rbdir.conn.fs_abilities.single_set_globals(Globals.rbdir, read_only) - except IOError, exc: + except (OSError, IOError), exc: print("\n") Log.FatalError("Could not open rdiff-backup directory\n\n%s\n\n" "due to\n\n%s" % (Globals.rbdir.path, exc)) @@ -876,7 +883,12 @@ information in it. """ % (Globals.rbdir.path,)) elif len(curmir_incs) == 1: return 0 else: - if not force: curmir_incs[0].conn.regress.check_pids(curmir_incs) + if not force: + try: + curmir_incs[0].conn.regress.check_pids(curmir_incs) + except (OSError, IOError), exc: + Log.FatalError("Could not check if rdiff-backup is currently" + "running due to\n%s" % exc) assert len(curmir_incs) == 2, "Found too many current_mirror incs!" return 1 |