File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / rsync / rsyncdb.1.html
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Mar 17 00:32:36 2021 UTC (3 years, 2 months ago) by misho
Branches: rsync, MAIN
CVS tags: v3_2_3, HEAD
rsync 3.2.3

<html><head>
<title>rsyncdb(1) man page</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Mono&display=swap" rel="stylesheet">
<style>
body {
  max-width: 50em;
  margin: auto;
}
body, b, strong, u {
  font-family: 'Roboto', sans-serif;
}
code {
  font-family: 'Roboto Mono', monospace;
  font-weight: bold;
  white-space: pre;
}
pre code {
  display: block;
  font-weight: normal;
}
blockquote pre code {
  background: #f1f1f1;
}
dd p:first-of-type {
  margin-block-start: 0em;
}
</style>
</head><body>
<h1>NAME</h1>
<p>rsyncdb -&#8288; Maintain an rsync checksum DB</p>
<h1>SYNOPSIS</h1>
<pre><code>rsyncdb --db=CONFIG [OPTION...] [DIR...]
</code></pre>
<h1>DESCRIPTION</h1>
<p>Rsyncdb can maintain a checksum-caching DB that rsync can use to make its
<code>--checksum</code> option more optimal.  You must specify a config file via
the <code>--db=CONFIG_FILE</code> option in order for rsyncdb to know what DB to
manipulate.  See the rsync manpage's <code>--db</code> option for full details on
the file's format.</p>
<p>You can specify one or more directory args for rsyncdb to scan.  If no
DIR args are specified, the current directory is assumed to be the spot
to start scanning.</p>
<p>Note that the rsyncdb program is usually just a symlink to the rsync program.
You can force rsync to behave as rsyncdb either by having a symlink (or
hardlink) name that ends with &quot;db&quot; or by <code>starting</code> the rsync args with
<code>--db-only=CONFIG</code> (and that option works just like <code>--db=CONFIG</code> to
a program named rsyncdb).</p>
<h1>EXAMPLES</h1>
<p>The following command will update checksum information in the database
described in the /etc/db.conf file:</p>
<blockquote>
<pre><code>rsyncdb --db=/etc/db.conf -o n --clean /dir1 /dir2
</code></pre>
</blockquote>
<p>It scans 2 directory hierarchies (/dir1 &amp; /dir2) and cleans out any
checksums whose inodes are no longer found in those directories (so that
directory args are presumed to be complete for this host's DB contents).</p>
<p>The following command will scan all the files in the /dir2 directory (without
recursive scanning, due to the <code>--no-r</code> option) and check them against
the DB:</p>
<blockquote>
<pre><code>rsyncdb --db=/etc/db.conf --check --no-r /dir2
</code></pre>
</blockquote>
<p>Any errors found are output as well as being fixed in the DB.  (See
<code>--no-update</code> for how to check without updating.)</p>
<p>The following command will output MD5 sums for all the files found in the
directories mentioned, even if they are unchanged (due to the
<code>--output=us</code> option):</p>
<blockquote>
<pre><code>rsyncdb --db=/etc/db.conf -rous /dir* &gt;/tmp/md5sums.txt
</code></pre>
</blockquote>
<p>This is just like running md5sum, only faster.  Unlike md5sum, you can't
specify a single file, so use <code>--no-r</code> and grep the output if you just
want to see a single file's value.</p>
<p>The following command initializes a new DB, and is required for any new DB:</p>
<blockquote>
<pre><code>rsyncdb --db=/etc/db.conf --init --mounts
</code></pre>
</blockquote>
<p>The <code>--init</code> option should only be used once (unless you want to
destroy existing data).  The <code>--mounts</code> option may need to be used
periodically, and makes use of a helper script (see below).</p>
<h1>OPTIONS SUMMARY</h1>
<p>Rsyncdb accepts the following options:</p>
<pre><code>--db=CONFIG       Specify the CONFIG file to read for the DB info
--db-lax          Ignore ctime changes (use with CAUTION)
--recursive, -r   Scan files in subdirs (the default w/o --no-recursive)
--sums=SUMS, -s   List which checksums to update (default: 4,5)
--output=STR, -o  One or more letters of what to output (default: &quot;&quot;)
--check, -c       Check checksums (by reading the files) and fix any
                  issues.  Makes --output default to &quot;dni&quot;.
--clean           Note all inodes in the DIRS and remove DB extras
--no-update, -N   Avoids updating/adding info w/--check and/or --clean
--init            Initialize a DB by (re-)creating its tables
--mounts          Scan for mounted filesystems and update the DB
--quiet, -q       Disable the default non-error output
--help, -h        Display this help message
</code></pre>
<h1>OPTIONS</h1>
<p>Rsyncdb accepts both long (double-dash + word) and short (single-dash + letter)
options.  The full list of the available options are described below.  If an
option can be specified in more than one way, the choices are comma-separated.
Some options only have a long variant, not a short.  If the option takes a
parameter, the parameter is only listed after the long variant, even though it
must also be specified for the short.  When specifying a parameter, you can
either use the form -&#8288;-&#8288;option=param or replace the '=' with whitespace.  The
parameter may need to be quoted in some manner for it to survive the shell's
command-line parsing.</p>
<dl>

<dt><code>--db=CONFIG_FILE</code></dt><dd>
<p>This tells rsyncdb what DB-config file to read for the DB setup.  This is
the same as the option in rsync, so refer to that manpage for full details.</p>
</dd>

<dt><code>--db-lax</code></dt><dd>
<p>This option works just like it does in rsync, so refer to that manpage for
full details.</p>
</dd>

<dt><code>--no-recursive, --no-r</code></dt><dd>
<p>This disables the default recursive directory scan that is performed on the
listed directory args.  The options <code>--recursive</code> and <code>-r</code> are also
accepted, if someone wants to override an earlier <code>--no-r</code> override.</p>
</dd>

<dt><code>--sums=SUMS, -s</code></dt><dd>
<p>Only output/update the listed checksum types. By default we deal with just
the newer md5 checksums (i.e.  <code>--sums=5</code>).</p>
<p>Note that this option does NOT affect the order that checksums are output
if &quot;-&#8288;o s&quot; is enabled, so <code>-s5,4</code> is the same as <code>-s4,5</code>.</p>
</dd>

<dt><code>--output=STR, -o</code></dt><dd>
<p>The output option lets you specify one or more letters indicating what
information should be output.  If <code>--output</code> is not specified, the default
is either &quot;dn&quot; or (with <code>--check</code>) &quot;dni&quot;.</p>
<p>The following letters are accepted in the string:</p>
<ul>
<li><code>d</code> outputs &quot;... dir_name ...&quot; lines for each directory in our scan.  if
&quot;d&quot; is omitted, then this progress indictor is not output.</li>
<li><code>n</code> includes the file's name in the per-file output. These lines are only
output for changed files unless &quot;u&quot; is given.  The &quot;n&quot; option is implied
by every other output option letter except &quot;d&quot;.</li>
<li><code>s</code> includes the checksum info in the per-file output.</li>
<li><code>c</code> is a synonym for 's'.</li>
<li><code>i</code> includes itemized change info in the per-file output.
<ul>
<li><code>!i</code> indicates that the time and/or size is wrong.</li>
<li><code>+4</code> indicates the MD4 sum is missing.</li>
<li><code>+5</code> indicates the MD5 sum is missing.</li>
<li><code>!4</code> indicates the MD4 sum is wrong.</li>
<li><code>!5</code> indicates the MD5 sum is wrong.</li>
<li><code>?4</code> indicates an unknown MD4 difference.  This can happen if we didn't
need to read the file; i.e. if the time/size is wrong and no sum info
was requested.</li>
<li><code>?5</code> indicates an unknown MD5 difference.</li>
</ul>
</li>
<li><code>u</code> includes unchanged files in the per-file output lines.</li>
</ul>
</dd>

<dt><code>--check, -c</code></dt><dd>
<p>Check the checksums (forcing the reading of all the files) and fix any
issues that are found.  Makes <code>--output</code> default to &quot;dni&quot;.</p>
</dd>

<dt><code>--clean</code></dt><dd>
<p>Makes a temp-DB of all the inodes that we find in all the listed
directories and removes any extraneous checksums from the DB.  You will
need to specify all the mounted directories that are present (and listed as
mounted) in the DB on this host or else the checksums from the unvisited
directories will be discarded from the DB.  If you want to just -&#8288;-&#8288;clean
without adding or updating the info of new or changed files, specify
<code>--no-update</code> as well.</p>
</dd>

<dt><code>--no-update, -N</code></dt><dd>
<p>Avoids updating/adding info with <code>--check</code> and/or <code>--clean</code>.</p>
</dd>

<dt><code>--quiet, -q</code></dt><dd>
<p>Disable the default (non-error) output settings.  This turns off the
messages that <code>--init</code>, <code>--mount</code>, and <code>--clean</code> output, and makes the
default for <code>--output</code> be nothing (though an explicit <code>--output</code> option is
not affected).</p>
</dd>

<dt><code>--init</code></dt><dd>
<p>Create the tables in the DB.  If it is used on an existing DB, all the
existing tables are dropped and re-created.</p>
</dd>
</dl>
<p>This option cannot be combined with the updating or reporting of checksum
information, but may be combined with <code>--mounts</code>.</p>
<dl>

<dt><code>--mounts</code></dt><dd>
<p>Populate the &quot;disk&quot; DB with the available device numbers and change any
mounted/unmount information for devices.  This should be run every time a
mount-change happens that may affect a directory hierarchy in the DB.
Rsyncdb will not save any checksums for a device that is not listed in the
&quot;disk&quot; table.</p>
<p>The helper script &quot;rsyncdb-mountinfo&quot; is used as the source of the mount
information on the host, which it derives from various system files and
UUID directories (if available).  That script supports the use of an
override file named &quot;.rsyncdb_mount_uniq&quot; in the root of the mount as one
way to manually assign unique values to a shared (mountable) device's
various disks.</p>
<p>Some advanced users may want to maintain the disk table themselves in order
to support mounting a drive in different (or multiple) locations, etc.</p>
<p>Specifying the <code>--mounts</code> option cannot be combined with updating or
reporting of checksum information, but may be combined with <code>--init</code>.</p>
</dd>

<dt><code>--help, -h</code></dt><dd>
<p>Display a summary of the options.</p>
</dd>
</dl>
<h1>SEE ALSO</h1>
<p><strong>rsync</strong>(1)</p>
<h1>AUTHOR</h1>
<p>Rsyncdb was written by Wayne Davison.</p>
<div style="float: right"><p><i>06 Aug 2020</i></p></div>
</body></html>

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