diff options
Diffstat (limited to 'rdiff-backup/rdiff_backup/Main.py')
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index 04ce247..5a03fb5 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -30,7 +30,7 @@ import Globals, Time, SetConnections, selection, robust, rpath, \ action = None remote_cmd, remote_schema = None, None force = None -select_opts, select_mirror_opts = [], [] +select_opts = [] select_files = [] def parse_cmdlineoptions(arglist): @@ -84,8 +84,6 @@ def parse_cmdlineoptions(arglist): elif opt == "--exclude-globbing-filelist": select_opts.append((opt, arg)) select_files.append(sel_fl(arg)) - elif opt == "--exclude-mirror": - select_mirror_opts.append(("--exclude", arg)) elif (opt == "--exclude-other-filesystems" or opt == "--exclude-regexp" or opt == "--exclude-special-files"): select_opts.append((opt, arg)) @@ -399,11 +397,23 @@ def restore_common(rpin, target, time): restore_check_backup_dir(mirror_root) mirror = mirror_root.new_index(index) inc_rpath = datadir.append_path('increments', index) - restore_init_select(mirror_root, target) + restore_set_select(mirror_root, target) restore_start_log(rpin, target, time) restore.Restore(mirror, inc_rpath, target, time) Log("Restore ended", 4) +def restore_set_select(mirror_rp, target): + """Set the selection iterator on mirror side from command line args + + Here we set the selector on the mirror side, because that is where + we will be filtering, but the pathnames are relative to the target + directory. + + """ + if select_opts: + mirror_rp.conn.restore.MirrorStruct.set_mirror_select( + target, select_opts, *select_files) + def restore_start_log(rpin, target, time): """Open restore log file, log initial message""" try: Log.open_logfile(datadir.append("restore.log")) @@ -446,19 +456,6 @@ def restore_check_backup_dir(rpin): "Rerun rdiff-backup with --check-destination-dir option to revert" "directory to state before unsuccessful session." % (rpin.path,)) -def restore_init_select(rpin, rpout): - """Initialize Select - - Unlike the backup selections, here they are on the local - connection, because the backup operation is pipelined in a way - the restore operation isn't. - - """ - restore._select_mirror = selection.Select(rpin) - restore._select_mirror.ParseArgs(select_mirror_opts, []) - restore._select_mirror.parse_rbdir_exclude() - restore._select_source = selection.Select(rpout) - def restore_get_root(rpin): """Return (mirror root, index) and set the data dir |