3 from os.path import relpath
4 from bup import options, drecurse
5 from bup.helpers import *
10 x,xdev,one-file-system don't cross filesystem boundaries
11 exclude= a path to exclude from the backup (can be used more than once)
12 exclude-from= a file that contains exclude paths (can be used more than once)
13 exclude-rx= skip paths matching the unanchored regex (may be repeated)
14 exclude-rx-from= skip --exclude-rx patterns in file (may be repeated)
15 q,quiet don't actually print filenames
16 profile run under the python profiler
18 o = options.Options(optspec)
19 (opt, flags, extra) = o.parse(sys.argv[1:])
22 o.fatal("exactly one filename expected")
24 drecurse_top = extra[0]
25 excluded_paths = parse_excludes(flags, o.fatal)
26 if not drecurse_top.startswith('/'):
27 excluded_paths = [relpath(x) for x in excluded_paths]
28 exclude_rxs = parse_rx_excludes(flags, o.fatal)
29 it = drecurse.recursive_dirlist([drecurse_top], opt.xdev,
30 excluded_paths=excluded_paths,
31 exclude_rxs=exclude_rxs)
37 cProfile.run('do_it()')
47 log('WARNING: %d errors encountered.\n' % len(saved_errors))