# SYNOPSIS
-bup index <-p|-m|-u> [-s] [-H] [-l] [-x] [--fake-valid]
-[--check] [-f *indexfile*] [--exclude *path*]
+bup index <-p|-m|-s|-u> [-H] [-l] [-x] [--fake-valid]
+[--fake-invalid] [--check] [-f *indexfile*] [--exclude *path*]
[--exclude-from *filename*] [-v] <filenames...>
# DESCRIPTION
need the same information).
-# OPTIONS
+# MODES
-u, --update
-: (recursively) update the index for the given filenames and
+: recursively update the index for the given filenames and
their descendants. One or more filenames must be
- given.
+ given. If no mode option is given, this is the
+ default.
-p, --print
: print the contents of the index. If filenames are
that a file is marked in the index as added, modified,
deleted, or unchanged since the last backup.
+
+# OPTIONS
+
-H, --hash
: for each file printed, prepend the most recently
recorded hash code. The hash code is normally
unnecessarily backing up files that you know are
boring.
+--fake-invalid
+: mark specified filenames as not up-to-date, forcing the
+ next "bup save" run to re-check their contents.
+
--check
: carefully check index file integrity before and after
updating. Mostly useful for automated tests.
optspec = """
-bup index <-p|m|u> [options...] <filenames...>
+bup index <-p|m|s|u> [options...] <filenames...>
--
+ Modes:
p,print print the index entries for the given names (also works with -u)
m,modified print only added/deleted/modified files (implies -p)
s,status print each filename with a status char (A/M/D) (implies -p)
-H,hash print the hash for each object next to its name (implies -p)
+u,update recursively update the index entries for the given file/dir names (default if no mode is specified)
+check carefully check index file integrity
+ Options:
+H,hash print the hash for each object next to its name
l,long print more information about each file
-u,update (recursively) update the index entries for the given filenames
-x,xdev,one-file-system don't cross filesystem boundaries
fake-valid mark all index entries as up-to-date even if they aren't
fake-invalid mark all index entries as invalid
-check carefully check index file integrity
f,indexfile= the name of the index file (normally BUP_DIR/bupindex)
exclude= a path to exclude from the backup (can be used more than once)
exclude-from= a file that contains exclude paths (can be used more than once)
v,verbose increase log output (can be used more than once)
+x,xdev,one-file-system don't cross filesystem boundaries
"""
o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:])
if not (opt.modified or opt['print'] or opt.status or opt.update or opt.check):
- o.fatal('supply one or more of -p, -s, -m, -u, or --check')
+ opt.update = 1
if (opt.fake_valid or opt.fake_invalid) and not opt.update:
o.fatal('--fake-{in,}valid are meaningless without -u')
if opt.fake_valid and opt.fake_invalid:
if opt.update:
if not extra:
- o.fatal('update (-u) requested but no paths given')
+ o.fatal('update mode (-u) requested but no paths given')
for (rp,path) in paths:
update_index(rp, excluded_paths)