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