diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-12-30 07:00:32 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2005-12-30 07:00:32 +0000 |
commit | 91cec4baf3f0772c52d29b92fc3b1186b1af5d85 (patch) | |
tree | eba1dd4bb57bef1b10091d322489d3fed3afc7a8 /rdiff-backup/rdiff_backup/Main.py | |
parent | 867009522ee98327a90f612d3015d384a71acfbf (diff) | |
download | rdiff-backup-91cec4baf3f0772c52d29b92fc3b1186b1af5d85.tar.gz |
Allow --forced restore over non-directory
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@730 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/Main.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index 87243d6..54aa625 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -535,13 +535,14 @@ def restore_start_log(rpin, target, time): if Log.verbosity >= 3: Log.log_to_file(log_message) def restore_check_paths(rpin, rpout, restoreasof = None): - """Check paths and return pair of corresponding rps""" + """Make sure source and destination exist, and have appropriate type""" if not restoreasof: if not rpin.lstat(): Log.FatalError("Source file %s does not exist" % rpin.path) if not force and rpout.lstat() and (not rpout.isdir() or rpout.listdir()): Log.FatalError("Restore target %s already exists, " "specify --force to overwrite." % rpout.path) + if force and rpout.lstat() and not rpout.isdir(): rpout.delete() def restore_check_backup_dir(mirror_root, src_rp = None, restore_as_of = 1): """Make sure backup dir root rpin is in consistent state""" |