3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
8 from os.path import relpath
11 from bup import options, drecurse
12 from bup.helpers import log, parse_excludes, parse_rx_excludes, saved_errors
18 x,xdev,one-file-system don't cross filesystem boundaries
19 exclude= a path to exclude from the backup (can be used more than once)
20 exclude-from= a file that contains exclude paths (can be used more than once)
21 exclude-rx= skip paths matching the unanchored regex (may be repeated)
22 exclude-rx-from= skip --exclude-rx patterns in file (may be repeated)
23 q,quiet don't actually print filenames
24 profile run under the python profiler
26 o = options.Options(optspec)
27 (opt, flags, extra) = o.parse(sys.argv[1:])
30 o.fatal("exactly one filename expected")
32 drecurse_top = extra[0]
33 excluded_paths = parse_excludes(flags, o.fatal)
34 if not drecurse_top.startswith('/'):
35 excluded_paths = [relpath(x) for x in excluded_paths]
36 exclude_rxs = parse_rx_excludes(flags, o.fatal)
37 it = drecurse.recursive_dirlist([drecurse_top], opt.xdev,
38 excluded_paths=excluded_paths,
39 exclude_rxs=exclude_rxs)
45 cProfile.run('do_it()')
55 log('WARNING: %d errors encountered.\n' % len(saved_errors))