Annotation of embedaddon/rsync/rsyncdb.1.md, revision 1.1.1.1

1.1       misho       1: # NAME
                      2: 
                      3: rsyncdb - Maintain an rsync checksum DB
                      4: 
                      5: # SYNOPSIS
                      6: 
                      7: ```
                      8: rsyncdb --db=CONFIG [OPTION...] [DIR...]
                      9: ```
                     10: 
                     11: # DESCRIPTION
                     12: 
                     13: Rsyncdb can maintain a checksum-caching DB that rsync can use to make its
                     14: `--checksum` option more optimal.  You must specify a config file via
                     15: the `--db=CONFIG_FILE` option in order for rsyncdb to know what DB to
                     16: manipulate.  See the rsync manpage's `--db` option for full details on
                     17: the file's format.
                     18: 
                     19: You can specify one or more directory args for rsyncdb to scan.  If no
                     20: DIR args are specified, the current directory is assumed to be the spot
                     21: to start scanning.
                     22: 
                     23: Note that the rsyncdb program is usually just a symlink to the rsync program.
                     24: You can force rsync to behave as rsyncdb either by having a symlink (or
                     25: hardlink) name that ends with "db" or by `starting` the rsync args with
                     26: `--db-only=CONFIG` (and that option works just like `--db=CONFIG` to
                     27: a program named rsyncdb).
                     28: 
                     29: # EXAMPLES
                     30: 
                     31: The following command will update checksum information in the database
                     32: described in the /etc/db.conf file:
                     33: 
                     34: >     rsyncdb --db=/etc/db.conf -o n --clean /dir1 /dir2
                     35: 
                     36: It scans 2 directory hierarchies (/dir1 & /dir2) and cleans out any
                     37: checksums whose inodes are no longer found in those directories (so that
                     38: directory args are presumed to be complete for this host's DB contents).
                     39: 
                     40: The following command will scan all the files in the /dir2 directory (without
                     41: recursive scanning, due to the `--no-r` option) and check them against
                     42: the DB:
                     43: 
                     44: >     rsyncdb --db=/etc/db.conf --check --no-r /dir2
                     45: 
                     46: Any errors found are output as well as being fixed in the DB.  (See
                     47: `--no-update` for how to check without updating.)
                     48: 
                     49: The following command will output MD5 sums for all the files found in the
                     50: directories mentioned, even if they are unchanged (due to the
                     51: `--output=us` option):
                     52: 
                     53: >     rsyncdb --db=/etc/db.conf -rous /dir* >/tmp/md5sums.txt
                     54: 
                     55: This is just like running md5sum, only faster.  Unlike md5sum, you can't
                     56: specify a single file, so use `--no-r` and grep the output if you just
                     57: want to see a single file's value.
                     58: 
                     59: The following command initializes a new DB, and is required for any new DB:
                     60: 
                     61: >     rsyncdb --db=/etc/db.conf --init --mounts
                     62: 
                     63: The `--init` option should only be used once (unless you want to
                     64: destroy existing data).  The `--mounts` option may need to be used
                     65: periodically, and makes use of a helper script (see below).
                     66: 
                     67: # OPTIONS SUMMARY
                     68: 
                     69: Rsyncdb accepts the following options:
                     70: 
                     71: [comment]: # (help-rsyncdb.h)
                     72: 
                     73: ```
                     74: --db=CONFIG       Specify the CONFIG file to read for the DB info
                     75: --db-lax          Ignore ctime changes (use with CAUTION)
                     76: --recursive, -r   Scan files in subdirs (the default w/o --no-recursive)
                     77: --sums=SUMS, -s   List which checksums to update (default: 4,5)
                     78: --output=STR, -o  One or more letters of what to output (default: "")
                     79: --check, -c       Check checksums (by reading the files) and fix any
                     80:                   issues.  Makes --output default to "dni".
                     81: --clean           Note all inodes in the DIRS and remove DB extras
                     82: --no-update, -N   Avoids updating/adding info w/--check and/or --clean
                     83: --init            Initialize a DB by (re-)creating its tables
                     84: --mounts          Scan for mounted filesystems and update the DB
                     85: --quiet, -q       Disable the default non-error output
                     86: --help, -h        Display this help message
                     87: ```
                     88: 
                     89: # OPTIONS
                     90: 
                     91: Rsyncdb accepts both long (double-dash + word) and short (single-dash + letter)
                     92: options.  The full list of the available options are described below.  If an
                     93: option can be specified in more than one way, the choices are comma-separated.
                     94: Some options only have a long variant, not a short.  If the option takes a
                     95: parameter, the parameter is only listed after the long variant, even though it
                     96: must also be specified for the short.  When specifying a parameter, you can
                     97: either use the form --option=param or replace the '=' with whitespace.  The
                     98: parameter may need to be quoted in some manner for it to survive the shell's
                     99: command-line parsing.
                    100: 
                    101: 0.  `--db=CONFIG_FILE`
                    102: 
                    103:     This tells rsyncdb what DB-config file to read for the DB setup.  This is
                    104:     the same as the option in rsync, so refer to that manpage for full details.
                    105: 
                    106: 0.  `--db-lax`
                    107: 
                    108:     This option works just like it does in rsync, so refer to that manpage for
                    109:     full details.
                    110: 
                    111: 0.  `--no-recursive, --no-r`
                    112: 
                    113:     This disables the default recursive directory scan that is performed on the
                    114:     listed directory args.  The options `--recursive` and `-r` are also
                    115:     accepted, if someone wants to override an earlier `--no-r` override.
                    116: 
                    117: 0.  `--sums=SUMS, -s`
                    118: 
                    119:     Only output/update the listed checksum types. By default we deal with just
                    120:     the newer md5 checksums (i.e.  `--sums=5`).
                    121: 
                    122:     Note that this option does NOT affect the order that checksums are output
                    123:     if "-o s" is enabled, so `-s5,4` is the same as `-s4,5`.
                    124: 
                    125: 0.  `--output=STR, -o`
                    126: 
                    127:     The output option lets you specify one or more letters indicating what
                    128:     information should be output.  If `--output` is not specified, the default
                    129:     is either "dn" or (with `--check`) "dni".
                    130: 
                    131:     The following letters are accepted in the string:
                    132: 
                    133:     - `d` outputs "... dir_name ..." lines for each directory in our scan.  if
                    134:       "d" is omitted, then this progress indictor is not output.
                    135:     - `n` includes the file's name in the per-file output. These lines are only
                    136:       output for changed files unless "u" is given.  The "n" option is implied
                    137:       by every other output option letter except "d".
                    138:     - `s` includes the checksum info in the per-file output.
                    139:     - `c` is a synonym for 's'.
                    140:     - `i` includes itemized change info in the per-file output.
                    141:       - `!i` indicates that the time and/or size is wrong.
                    142:       - `+4` indicates the MD4 sum is missing.
                    143:       - `+5` indicates the MD5 sum is missing.
                    144:       - `!4` indicates the MD4 sum is wrong.
                    145:       - `!5` indicates the MD5 sum is wrong.
                    146:       - `?4` indicates an unknown MD4 difference.  This can happen if we didn't
                    147:        need to read the file; i.e. if the time/size is wrong and no sum info
                    148:        was requested.
                    149:       - `?5` indicates an unknown MD5 difference.
                    150:     - `u` includes unchanged files in the per-file output lines.
                    151: 
                    152: 0.  `--check, -c`
                    153: 
                    154:     Check the checksums (forcing the reading of all the files) and fix any
                    155:     issues that are found.  Makes `--output` default to "dni".
                    156: 
                    157: 0.  `--clean`
                    158: 
                    159:     Makes a temp-DB of all the inodes that we find in all the listed
                    160:     directories and removes any extraneous checksums from the DB.  You will
                    161:     need to specify all the mounted directories that are present (and listed as
                    162:     mounted) in the DB on this host or else the checksums from the unvisited
                    163:     directories will be discarded from the DB.  If you want to just --clean
                    164:     without adding or updating the info of new or changed files, specify
                    165:     `--no-update` as well.
                    166: 
                    167: 0.  `--no-update, -N`
                    168: 
                    169:     Avoids updating/adding info with `--check` and/or `--clean`.
                    170: 
                    171: 0.  `--quiet, -q`
                    172: 
                    173:     Disable the default (non-error) output settings.  This turns off the
                    174:     messages that `--init`, `--mount`, and `--clean` output, and makes the
                    175:     default for `--output` be nothing (though an explicit `--output` option is
                    176:     not affected).
                    177: 
                    178: 0.  `--init`
                    179: 
                    180:     Create the tables in the DB.  If it is used on an existing DB, all the
                    181:     existing tables are dropped and re-created.
                    182: 
                    183: This option cannot be combined with the updating or reporting of checksum
                    184: information, but may be combined with `--mounts`.
                    185: 
                    186: 0.  `--mounts`
                    187: 
                    188:     Populate the "disk" DB with the available device numbers and change any
                    189:     mounted/unmount information for devices.  This should be run every time a
                    190:     mount-change happens that may affect a directory hierarchy in the DB.
                    191:     Rsyncdb will not save any checksums for a device that is not listed in the
                    192:     "disk" table.
                    193: 
                    194:     The helper script "rsyncdb-mountinfo" is used as the source of the mount
                    195:     information on the host, which it derives from various system files and
                    196:     UUID directories (if available).  That script supports the use of an
                    197:     override file named ".rsyncdb_mount_uniq" in the root of the mount as one
                    198:     way to manually assign unique values to a shared (mountable) device's
                    199:     various disks.
                    200: 
                    201:     Some advanced users may want to maintain the disk table themselves in order
                    202:     to support mounting a drive in different (or multiple) locations, etc.
                    203: 
                    204:     Specifying the `--mounts` option cannot be combined with updating or
                    205:     reporting of checksum information, but may be combined with `--init`.
                    206: 
                    207: 0.  `--help, -h`
                    208: 
                    209:     Display a summary of the options.
                    210: 
                    211: # SEE ALSO
                    212: 
                    213: **rsync**(1)
                    214: 
                    215: # AUTHOR
                    216: 
                    217: Rsyncdb was written by Wayne Davison.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>