Commit e4a7371d authored by owsla's avatar owsla

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@980 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 65ac096d
New in v1.2.3 (????/??/??) New in v1.2.3 (????/??/??)
--------------------------- ---------------------------
Print a more helpful error message if we get an error while reading an old
current_mirror marker. This can happen because it has been locked or deleted
by a just-finished rdiff-backup process. Closes Ubuntu bugs #88140 and
#284506. (Andrew Ferguson)
Do not backup reparse points on native Windows. Thanks to John Covici for Do not backup reparse points on native Windows. Thanks to John Covici for
reporting the issue. (Andrew Ferguson) reporting the issue. (Andrew Ferguson)
......
...@@ -424,7 +424,10 @@ def fix_failed_initial_backup(): ...@@ -424,7 +424,10 @@ def fix_failed_initial_backup():
def backup_set_rbdir(rpin, rpout): def backup_set_rbdir(rpin, rpout):
"""Initialize data dir and logging""" """Initialize data dir and logging"""
global incdir 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()) assert rpout.lstat(), (rpout.path, rpout.lstat())
if rpout.isdir() and not rpout.listdir(): # rpout is empty dir 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): ...@@ -543,7 +546,11 @@ def Restore(src_rp, dest_rp, restore_as_of = None):
Log.FatalError("Could not find rdiff-backup repository at " Log.FatalError("Could not find rdiff-backup repository at "
+ src_rp.path) + src_rp.path)
restore_check_paths(src_rp, dest_rp, restore_as_of) 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) init_user_group_mapping(dest_rp.conn)
src_rp = restore_init_quoting(src_rp) src_rp = restore_init_quoting(src_rp)
restore_check_backup_dir(restore_root, src_rp, restore_as_of) restore_check_backup_dir(restore_root, src_rp, restore_as_of)
...@@ -710,7 +717,7 @@ def require_root_set(rp, read_only): ...@@ -710,7 +717,7 @@ def require_root_set(rp, read_only):
try: try:
Globals.rbdir.conn.fs_abilities.single_set_globals(Globals.rbdir, Globals.rbdir.conn.fs_abilities.single_set_globals(Globals.rbdir,
read_only) read_only)
except IOError, exc: except (OSError, IOError), exc:
print("\n") print("\n")
Log.FatalError("Could not open rdiff-backup directory\n\n%s\n\n" Log.FatalError("Could not open rdiff-backup directory\n\n%s\n\n"
"due to\n\n%s" % (Globals.rbdir.path, exc)) "due to\n\n%s" % (Globals.rbdir.path, exc))
...@@ -876,7 +883,12 @@ information in it. ...@@ -876,7 +883,12 @@ information in it.
""" % (Globals.rbdir.path,)) """ % (Globals.rbdir.path,))
elif len(curmir_incs) == 1: return 0 elif len(curmir_incs) == 1: return 0
else: 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!" assert len(curmir_incs) == 2, "Found too many current_mirror incs!"
return 1 return 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment