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