neulab/tldr huggingface dataset:
Note that you can feel free to write the batch directly to some portable media: if this media fills to capacity before the end of the transfer, you can just apply that partial transfer to the destination and repeat the whole process to get the rest of the changes (as long as you don't mind a partially updated destination system while the multi-update cycle is happening).
Also note that you only save bandwidth when pushing changes to a remote system because this allows the batched data to be diverted from the sender into the batch file without having to flow over the wire to the receiver (when pulling, the sender is remote, and thus can't write the batch).
--read-batch=FILE Apply all of the changes stored in FILE, a file previously generated by --write-batch.  If FILE is -, the batch data will be read from standard input. See the "BATCH MODE" section for details.
--protocol=NUM Force an older protocol version to be used.  This is useful for creating a batch file that is compatible with an older version of rsync.  For instance, if rsync 2.6.4 is being used with the --write-batch option, but rsync 2.6.3 is what will be used to run the --read-batch option, you should use "--protocol=28" when creating the batch file to force the older protocol version to be used in the batch file (assuming you can't upgrade the rsync on the reading system).
--iconv=CONVERT_SPEC Rsync can convert filenames between character sets using this option.  Using a CONVERT_SPEC of "." tells rsync to look up the default character-set via the locale setting.  Alternately, you can fully specify what conversion to do by giving a local and a remote charset separated by a comma in the order --iconv=LOCAL,REMOTE, e.g. --iconv=utf8,iso88591.  This order ensures that the option will stay the same whether you're pushing or pulling files.  Finally, you can specify either --no-iconv or a CONVERT_SPEC of "-" to turn off any conversion.  The default setting of this option is site-specific, and can also be affected via the RSYNC_ICONV environment variable.
For a list of what charset names your local iconv library supports, you can run "iconv --list".
If you specify the --protect-args option (-s), rsync will translate the filenames you specify on the command-line that are being sent to the remote host.  See also the --files-from option.
Note that rsync does not do any conversion of names in filter files (including include/exclude files).  It is up to you to ensure that you're specifying matching rules that can match on both sides of the transfer.  For instance, you can specify extra include/exclude rules if there are filename differences on the two sides that need to be accounted for.
When you pass an --iconv option to an rsync daemon that allows it, the daemon uses the charset specified in its "charset" configuration parameter regardless of the remote charset you actually pass.  Thus, you may feel free to specify just the local charset for a daemon transfer (e.g.  --iconv=utf8).
--ipv4, -4 or --ipv6, -6 Tells rsync to prefer IPv4/IPv6 when creating sockets or running ssh.  This affects sockets that rsync has direct control over, such as the outgoing socket when directly contacting an rsync daemon, as well as the forwarding of the -4 or -6 option to ssh when rsync can deduce that ssh is being used as the remote shell. For other remote shells you'll need to specify the "--rsh SHELL -4" option directly (or whatever ipv4/ipv6 hint options it uses).
These options also exist in the --daemon mode section.
If rsync was complied without support for IPv6, the --ipv6 option will have no effect.  The rsync --version output will contain "no IPv6" if is the case.
--checksum-seed=NUM Set the checksum seed to the integer NUM.  This 4 byte checksum seed is included in each block and MD4 file checksum calculation (the more modern MD5 file checksums don't use a seed).  By default the checksum seed is generated by the server and defaults to the current time().  This option is used to set a specific checksum seed, which is useful for applications that want repeatable block checksums, or in the case where the user wants a more random checksum seed.  Setting NUM to 0 causes rsync to use the default of time() for checksum seed.
The options allowed when starting an rsync daemon are as follows:
--daemon This tells rsync that it is to run as a daemon.  The daemon you start running may be accessed using an rsync client using the host::module or rsync://host/module/ syntax.
If standard input is a socket then rsync will assume that it is being run via inetd, otherwise it will detach from the current terminal and become a background daemon.  The daemon will read the config file (rsyncd.conf) on each connect made by a client and respond to requests accordingly.  See the rsyncd.conf(5) man page for more details.
--address=ADDRESS By default rsync will bind to the wildcard address when run as a daemon with the --daemon option.  The --address option allows you to specify a specific IP address (or hostname) to bind to.  This makes virtual hosting possible in conjunction with the --config option.  See also the "address" global option in the rsyncd.conf manpage.
--bwlimit=RATE This option allows you to specify the maximum transfer rate for the data the daemon sends over the socket.  The client can still specify a smaller --bwlimit value, but no larger value will be allowed.  See the client version of this option (above) for some extra details.
--config=FILE This specifies an alternate config file than the default.  This is only relevant when --daemon is specified.  The default is /etc/rsyncd.conf unless the daemon is running over a remote shell program and the remote user is not the super-user; in that case the default is rsyncd.conf in the current directory (typically $HOME).
--dparam=OVERRIDE, -M This option can be used to set a daemon-config parameter when starting up rsync in daemon mode.  It is equivalent to adding the parameter at the end of the global settings prior to the first module's definition.  The parameter names can be specified without spaces, if you so desire.  For instance:
rsync --daemon -M pidfile=/path/rsync.pid
--no-detach When running as a daemon, this option instructs rsync to not detach itself and become a background process.  This option is required when running as a service on Cygwin, and may also be useful when rsync is supervised by a program such as daemontools or AIX's System Resource Controller.  --no-detach is also recommended when rsync is run under a debugger.  This option has no effect if rsync is run from inetd or sshd.
--port=PORT This specifies an alternate TCP port number for the daemon to listen on rather than the default of 873.  See also the "port" global option in the rsyncd.conf manpage.
--log-file=FILE This option tells the rsync daemon to use the given log-file name instead of using the "log file" setting in the config file.
--log-file-format=FORMAT This option tells the rsync daemon to use the given FORMAT string instead of using the "log format" setting in the config file.  It also enables "transfer logging" unless the string is empty, in which case transfer logging is turned off.
--sockopts This overrides the socket options setting in the rsyncd.conf file and has the same syntax.
--verbose, -v This option increases the amount of information the daemon logs during its startup phase.  After the client connects, the daemon's verbosity level will be controlled by the options that the client used and the "max verbosity" setting in the module's config section.
--ipv4, -4 or --ipv6, -6 Tells rsync to prefer IPv4/IPv6 when creating the incoming sockets that the rsync daemon will use to listen for connections.  One of these options may be required in older versions of Linux to work around an IPv6 bug in the kernel (if you see an "address already in use" error when nothing else is using the port, try specifying --ipv6 or --ipv4 when starting the daemon).
These options also exist in the regular rsync options section.
--help, -h When specified after --daemon, print a short help page describing the options available for starting an rsync daemon.
The filter rules allow for flexible selection of which files to transfer (include) and which files to skip (exclude).  The rules either directly specify include/exclude patterns or they specify a way to acquire more include/exclude patterns (e.g. to read them from a file).
As the list of files/directories to transfer is built, rsync checks each name to be transferred against the list of include/exclude patterns in turn, and the first matching pattern is acted on: if it is an exclude pattern, then that file is skipped; if it is an include pattern then that filename is not skipped; if no matching pattern is found, then the filename is not skipped.
Rsync builds an ordered list of filter rules as specified on the command- line.  Filter rules have the following syntax:
RULE [PATTERN_OR_FILENAME] RULE,MODIFIERS [PATTERN_OR_FILENAME]
You have your choice of using either short or long RULE names, as described below.  If you use a short-named rule, the ',' separating the RULE from the MODIFIERS is optional.  The PATTERN or FILENAME that follows (when present) must come after either a single space or an underscore (_).  Here are the available rule prefixes:
exclude, '-' specifies an exclude pattern.
include, '+' specifies an include pattern.
merge, '.' specifies a merge-file to read for more rules.
dir-merge, ':' specifies a per-directory merge-file.
hide, 'H' specifies a pattern for hiding files from the transfer.
show, 'S' files that match the pattern are not hidden.
protect, 'P' specifies a pattern for protecting files from deletion.
risk, 'R' files that match the pattern are not protected.
clear, '!' clears the current include/exclude list (takes no arg)
When rules are being read from a file, empty lines are ignored, as are comment lines that start with a "#".
Note that the --include & --exclude command-line options do not allow the full range of rule parsing as described above -- they only allow the specification of include / exclude patterns plus a "!" token to clear the list (and the normal comment parsing when rules are read from a file). If a pattern does not begin with "- " (dash, space) or "+ " (plus, space), then the rule will be interpreted as if "+ " (for an include option) or "- " (for an exclude option) were prefixed to the string.  A --filter option, on the other hand, must always contain either a short or long rule name at the start of the rule.
Note also that the --filter, --include, and --exclude options take one rule/pattern each.  To add multiple ones, you can repeat the options on the command-line, use the merge-file syntax of the --filter option, or the --include-from / --exclude-from options.
INCLUDE/EXCLUDE PATTERN RULES You can include and exclude files by specifying patterns using the "+", "-", etc. filter rules (as introduced in the FILTER RULES section above). The include/exclude rules each specify a pattern that is matched against the names of the files that are going to be transferred.  These patterns can take several forms:
o      if the pattern starts with a / then it is anchored to a particular spot in the hierarchy of files, otherwise it is matched against the end of the pathname.  This is similar to a leading ^ in regular expressions.  Thus /foo would match a name of "foo" at either the "root of the transfer" (for a global rule) or in the merge-file's directory (for a per-directory rule).  An unqualified foo would match a name of "foo" anywhere in the tree because the algorithm is applied recursively from the top down; it behaves as if each path component gets a turn at being the end of the filename.  Even the unanchored "sub/foo" would match at any point in the hierarchy where a "foo" was found within a directory named "sub".  See the section on ANCHORING INCLUDE/EXCLUDE PATTERNS for a full discussion of how to specify a pattern that matches at the root of the transfer.
o      if the pattern ends with a / then it will only match a directory, not a regular file, symlink, or device.
o      rsync chooses between doing a simple string match and wildcard matching by checking if the pattern contains one of these three wildcard characters: '*', '?', and '[' .
o      a '*' matches any path component, but it stops at slashes.
o      use '**' to match anything, including slashes.
o      a '?' matches any character except a slash (/).
o      a '[' introduces a character class, such as [a-z] or [[:alpha:]].
o      in a wildcard pattern, a backslash can be used to escape a wildcard character, but it is matched literally when no wildcards are present.  This means that there is an extra level of backslash removal when a pattern contains wildcard characters compared to a pattern that has none.  e.g. if you add a wildcard to "foo\bar" (which matches the backslash) you would need to use "foo\\bar*" to avoid the "\b" becoming just "b".
o      if the pattern contains a / (not counting a trailing /) or a "**", then it is matched against the full pathname, including any leading directories.  If the pattern doesn't contain a / or a "**", then it is matched only against the final component of the filename. (Remember that the algorithm is applied recursively so "full filename" can actually be any portion of a path from the starting directory on down.)
o      a trailing "dir_name/***" will match both the directory (as if "dir_name/" had been specified) and everything in the directory (as if "dir_name/**" had been specified).  This behavior was added in version 2.6.7.
Note that, when using the --recursive (-r) option (which is implied by -a), every subdir component of every path is visited left to right, with each directory having a chance for exclusion before its content.  In this way include/exclude patterns are applied recursively to the pathname of each node in the filesystem's tree (those inside the transfer).  The exclude patterns short-circuit the directory traversal stage as rsync finds the files to send.
For instance, to include "/foo/bar/baz", the directories "/foo" and "/foo/bar" must not be excluded.  Excluding one of those parent directories prevents the examination of its content, cutting off rsync's recursion into those paths and rendering the include for "/foo/bar/baz" ineffectual (since rsync can't match something it never sees in the cut- off section of the directory hierarchy).
The concept path exclusion is particularly important when using a trailing '*' rule.  For instance, this won't work:
+ /some/path/this-file-will-not-be-found + /file-is-included - *
This fails because the parent directory "some" is excluded by the '*' rule, so rsync never visits any of the files in the "some" or "some/path" directories.  One solution is to ask for all directories in the hierarchy to be included by using a single rule: "+ */" (put it somewhere before the "- *" rule), and perhaps use the --prune-empty-dirs option.  Another solution is to add specific include rules for all the parent dirs that need to be visited.  For instance, this set of rules works fine:
+ /some/ + /some/path/ + /some/path/this-file-is-found + /file-also-included - *
Here are some examples of exclude/include matching:
o      "- *.o" would exclude all names matching *.o
o      "- /foo" would exclude a file (or directory) named foo in the transfer-root directory
o      "- foo/" would exclude any directory named foo
o      "- /foo/*/bar" would exclude any file named bar which is at two levels below a directory named foo in the transfer-root directory
o      "- /foo/**/bar" would exclude any file named bar two or more levels below a directory named foo in the transfer-root directory
o      The combination of "+ */", "+ *.c", and "- *" would include all directories and C source files but nothing else (see also the --prune-empty-dirs option)
o      The combination of "+ foo/", "+ foo/bar.c", and "- *" would include only the foo directory and foo/bar.c (the foo directory must be explicitly included or it would be excluded by the "*")
The following modifiers are accepted after a "+" or "-":
o      A / specifies that the include/exclude rule should be matched against the absolute pathname of the current item.  For example, "-/ /etc/passwd" would exclude the passwd file any time the transfer was sending files from the "/etc" directory, and "-/ subdir/foo" would always exclude "foo" when it is in a dir named "subdir", even if "foo" is at the root of the current transfer.
o      A ! specifies that the include/exclude should take effect if the pattern fails to match.  For instance, "-! */" would exclude all non-directories.
o      A C is used to indicate that all the global CVS-exclude rules should be inserted as excludes in place of the "-C".  No arg should follow.
o      An s is used to indicate that the rule applies to the sending side.  When a rule affects the sending side, it prevents files from being transferred.  The default is for a rule to affect both sides unless --delete-excluded was specified, in which case default rules become sender-side only.  See also the hide (H) and show (S) rules, which are an alternate way to specify sending-side includes/excludes.
o      An r is used to indicate that the rule applies to the receiving side.  When a rule affects the receiving side, it prevents files from being deleted.  See the s modifier for more info.  See also the protect (P) and risk (R) rules, which are an alternate way to specify receiver-side includes/excludes.
o      A p indicates that a rule is perishable, meaning that it is ignored in directories that are being deleted.  For instance, the -C option's default rules that exclude things like "CVS" and "*.o" are marked as perishable, and will not prevent a directory that was removed on the source from being deleted on the destination.
o      An x indicates that a rule affects xattr names in xattr copy/delete operations (and is thus ignored when matching file/dir names).  If no xattr-matching rules are specified, a default xattr filtering rule is used (see the --xattrs option).
MERGE-FILE FILTER RULES You can merge whole files into your filter rules by specifying either a merge (.) or a dir-merge (:) filter rule (as introduced in the FILTER RULES section above).
There are two kinds of merged files -- single-instance ('.') and per- directory (':').  A single-instance merge file is read one time, and its rules are incorporated into the filter list in the place of the "." rule. For per-directory merge files, rsync will scan every directory that it traverses for the named file, merging its contents when the file exists into the current list of inherited rules.  These per-directory rule files must be created on the sending side because it is the sending side that is being scanned for the available files to transfer.  These rule files may also need to be transferred to the receiving side if you want them to affect what files don't get deleted (see PER-DIRECTORY RULES AND DELETE below).
merge /etc/rsync/default.rules . /etc/rsync/default.rules dir-merge .per-dir-filter dir-merge,n- .non-inherited-per-dir-excludes :n- .non-inherited-per-dir-excludes
The following modifiers are accepted after a merge or dir-merge rule:
o      A - specifies that the file should consist of only exclude patterns, with no other rule-parsing except for in-file comments.
o      A + specifies that the file should consist of only include patterns, with no other rule-parsing except for in-file comments.
o      A C is a way to specify that the file should be read in a CVS- compatible manner.  This turns on 'n', 'w', and '-', but also allows the list-clearing token (!) to be specified.  If no filename is provided, ".cvsignore" is assumed.
o      A e will exclude the merge-file name from the transfer; e.g. "dir-merge,e .rules" is like "dir-merge .rules" and "- .rules".
o      An n specifies that the rules are not inherited by subdirectories.
o      A w specifies that the rules are word-split on whitespace instead of the normal line-splitting.  This also turns off comments. Note: the space that separates the prefix from the rule is treated specially, so "- foo + bar" is parsed as two rules (assuming that prefix-parsing wasn't also disabled).
o      You may also specify any of the modifiers for the "+" or "-" rules (above) in order to have the rules that are read in from the file default to having that modifier set (except for the ! modifier, which would not be useful).  For instance, "merge,-/ .excl" would treat the contents of .excl as absolute-path excludes, while "dir- merge,s .filt" and ":sC" would each make all their per-directory rules apply only on the sending side.  If the merge rule specifies sides to affect (via the s or r modifier or both), then the rules in the file must not specify sides (via a modifier or a rule prefix such as hide).
Per-directory rules are inherited in all subdirectories of the directory where the merge-file was found unless the 'n' modifier was used.  Each subdirectory's rules are prefixed to the inherited per-directory rules from its parents, which gives the newest rules a higher priority than the inherited rules.  The entire set of dir-merge rules are grouped together in the spot where the merge-file was specified, so it is possible to override dir-merge rules via a rule that got specified earlier in the list of global rules.  When the list-clearing rule ("!") is read from a per-directory file, it only clears the inherited rules for the current merge file.
Another way to prevent a single rule from a dir-merge file from being inherited is to anchor it with a leading slash.  Anchored rules in a per- directory merge-file are relative to the merge-file's directory, so a pattern "/foo" would only match the file "foo" in the directory where the dir-merge filter file was found.
Here's an example filter file which you'd specify via --filter=". file":
merge /home/user/.global-filter - *.gz dir-merge .rules + *.[ch] - *.o - foo*
This will merge the contents of the /home/user/.global-filter file at the start of the list and also turns the ".rules" filename into a per- directory filter file.  All rules read in prior to the start of the directory scan follow the global anchoring rules (i.e. a leading slash matches at the root of the transfer).
If a per-directory merge-file is specified with a path that is a parent directory of the first transfer directory, rsync will scan all the parent dirs from that starting point to the transfer directory for the indicated per-directory file.  For instance, here is a common filter (see -F):
--filter=': /.rsync-filter'
That rule tells rsync to scan for the file .rsync-filter in all directories from the root down through the parent directory of the transfer prior to the start of the normal directory scan of the file in the directories that are sent as a part of the transfer. (Note: for an rsync daemon, the root is always the same as the module's "path".)
Some examples of this pre-scanning for per-directory files:
rsync -avF /src/path/ /dest/dir rsync -av --filter=': ../../.rsync-filter' /src/path/ /dest/dir rsync -av --filter=': .rsync-filter' /src/path/ /dest/dir
The first two commands above will look for ".rsync-filter" in "/" and "/src" before the normal scan begins looking for the file in "/src/path" and its subdirectories.  The last command avoids the parent-dir scan and only looks for the ".rsync-filter" files in each directory that is a part of the transfer.
If you want to include the contents of a ".cvsignore" in your patterns, you should use the rule ":C", which creates a dir-merge of the .cvsignore file, but parsed in a CVS-compatible manner.  You can use this to affect where the --cvs-exclude (-C) option's inclusion of the per-directory .cvsignore file gets placed into your rules by putting the ":C" wherever you like in your filter rules.  Without this, rsync would add the dir- merge rule for the .cvsignore file at the end of all your other rules (giving it a lower priority than your command-line rules).  For example:
cat <<EOT | rsync -avC --filter='. -' a/ b + foo.o :C - *.old EOT rsync -avC --include=foo.o -f :C --exclude='*.old' a/ b
Both of the above rsync commands are identical.  Each one will merge all the per-directory .cvsignore rules in the middle of the list rather than at the end.  This allows their dir-specific rules to supersede the rules that follow the :C instead of being subservient to all your rules.  To affect the other CVS exclude rules (i.e. the default list of exclusions, the contents of $HOME/.cvsignore, and the value of $CVSIGNORE) you should omit the -C command-line option and instead insert a "-C" rule into your filter rules; e.g.  "--filter=-C".
LIST-CLEARING FILTER RULE You can clear the current include/exclude list by using the "!" filter rule (as introduced in the FILTER RULES section above).  The "current" list is either the global list of rules (if the rule is encountered while parsing the filter options) or a set of per-directory rules (which are inherited in their own sub-list, so a subdirectory can use this to clear out the parent's rules).
ANCHORING INCLUDE/EXCLUDE PATTERNS As mentioned earlier, global include/exclude patterns are anchored at the "root of the transfer" (as opposed to per-directory patterns, which are anchored at the merge-file's directory).  If you think of the transfer as a subtree of names that are being sent from sender to receiver, the transfer-root is where the tree starts to be duplicated in the destination directory.  This root governs where patterns that start with a / match.
Because the matching is relative to the transfer-root, changing the trailing slash on a source path or changing your use of the --relative option affects the path you need to use in your matching (in addition to changing how much of the file tree is duplicated on the destination host).  The following examples demonstrate this.
Let's say that we want to match two source files, one with an absolute path of "/home/me/foo/bar", and one with a path of "/home/you/bar/baz". Here is how the various command choices differ for a 2-source transfer:
Example cmd: rsync -a /home/me /home/you /dest +/- pattern: /me/foo/bar +/- pattern: /you/bar/baz Target file: /dest/me/foo/bar Target file: /dest/you/bar/baz
Example cmd: rsync -a /home/me/ /home/you/ /dest +/- pattern: /foo/bar               (note missing "me") +/- pattern: /bar/baz               (note missing "you") Target file: /dest/foo/bar Target file: /dest/bar/baz
Example cmd: rsync -a --relative /home/me/ /home/you /dest +/- pattern: /home/me/foo/bar       (note full path) +/- pattern: /home/you/bar/baz      (ditto) Target file: /dest/home/me/foo/bar Target file: /dest/home/you/bar/baz
Example cmd: cd /home; rsync -a --relative me/foo you/ /dest +/- pattern: /me/foo/bar      (starts at specified path) +/- pattern: /you/bar/baz     (ditto) Target file: /dest/me/foo/bar Target file: /dest/you/bar/baz
The easiest way to see what name you should filter is to just look at the output when using --verbose and put a / in front of the name (use the --dry-run option if you're not yet ready to copy any files).
PER-DIRECTORY RULES AND DELETE Without a delete option, per-directory rules are only relevant on the sending side, so you can feel free to exclude the merge files themselves without affecting the transfer.  To make this easy, the 'e' modifier adds this exclude for you, as seen in these two equivalent commands:
rsync -av --filter=': .excl' --exclude=.excl host:src/dir /dest rsync -av --filter=':e .excl' host:src/dir /dest
However, if you want to do a delete on the receiving side AND you want some files to be excluded from being deleted, you'll need to be sure that the receiving side knows what files to exclude.  The easiest way is to include the per-directory merge files in the transfer and use --delete- after, because this ensures that the receiving side gets all the same exclude rules as the sending side before it tries to delete anything:
rsync -avF --delete-after host:src/dir /dest
However, if the merge files are not a part of the transfer, you'll need to either specify some global exclude rules (i.e. specified on the command line), or you'll need to maintain your own per-directory merge files on the receiving side.  An example of the first is this (assume that the remote .rules files exclude themselves):
rsync -av --filter=': .rules' --filter='. /my/extra.rules' --delete host:src/dir /dest
In the above example the extra.rules file can affect both sides of the transfer, but (on the sending side) the rules are subservient to the rules merged from the .rules files because they were specified after the per-directory merge rule.
In one final example, the remote side is excluding the .rsync-filter files from the transfer, but we want to use our own .rsync-filter files to control what gets deleted on the receiving side.  To do this we must specifically exclude the per-directory merge files (so that they don't get deleted) and then put rules into the local files to control what else should not get deleted.  Like one of these commands:
rsync -av --filter=':e /.rsync-filter' --delete \ host:src/dir /dest rsync -avFF --delete host:src/dir /dest
Batch mode can be used to apply the same set of updates to many identical systems.  Suppose one has a tree which is replicated on a number of hosts.  Now suppose some changes have been made to this source tree and those changes need to be propagated to the other hosts.  In order to do this using batch mode, rsync is run with the write-batch option to apply the changes made to the source tree to one of the destination trees.  The write-batch option causes the rsync client to store in a "batch file" all the information needed to repeat this operation against other, identical destination trees.
Generating the batch file once saves having to perform the file status, checksum, and data block generation more than once when updating multiple destination trees.  Multicast transport protocols can be used to transfer the batch update files in parallel to many hosts at once, instead of sending the same data to every host individually.
To apply the recorded changes to another destination tree, run rsync with the read-batch option, specifying the name of the same batch file, and the destination tree.  Rsync updates the destination tree using the information stored in the batch file.
For your convenience, a script file is also created when the write-batch option is used: it will be named the same as the batch file with ".sh" appended.  This script file contains a command-line suitable for updating a destination tree using the associated batch file.  It can be executed using a Bourne (or Bourne-like) shell, optionally passing in an alternate destination tree pathname which is then used instead of the original destination path.  This is useful when the destination tree path on the current host differs from the one used to create the batch file.
$ rsync --write-batch=foo -a host:/source/dir/ /adest/dir/ $ scp foo* remote: $ ssh remote ./foo.sh /bdest/dir/
$ rsync --write-batch=foo -a /source/dir/ /adest/dir/ $ ssh remote rsync --read-batch=- -a /bdest/dir/ <foo
In these examples, rsync is used to update /adest/dir/ from /source/dir/ and the information to repeat this operation is stored in "foo" and "foo.sh".  The host "remote" is then updated with the batched data going into the directory /bdest/dir.  The differences between the two examples reveals some of the flexibility you have in how you deal with batches:
o      The first example shows that the initial copy doesn't have to be local -- you can push or pull data to/from a remote host using either the remote-shell syntax or rsync daemon syntax, as desired.
o      The first example uses the created "foo.sh" file to get the right rsync options when running the read-batch command on the remote host.
o      The second example reads the batch data via standard input so that the batch file doesn't need to be copied to the remote machine first.  This example avoids the foo.sh script because it needed to use a modified --read-batch option, but you could edit the script file if you wished to make use of it (just be sure that no other option is trying to use standard input, such as the "--exclude- from=-" option).
The read-batch option expects the destination tree that it is updating to be identical to the destination tree that was used to create the batch update fileset.  When a difference between the destination trees is encountered the update might be discarded with a warning (if the file appears to be up-to-date already) or the file-update may be attempted and then, if the file fails to verify, the update discarded with an error. This means that it should be safe to re-run a read-batch operation if the command got interrupted.  If you wish to force the batched-update to always be attempted regardless of the file's size and date, use the -I option (when reading the batch).  If an error occurs, the destination tree will probably be in a partially updated state.  In that case, rsync can be used in its regular (non-batch) mode of operation to fix up the destination tree.
The rsync version used on all destinations must be at least as new as the one used to generate the batch file.  Rsync will die with an error if the protocol version in the batch file is too new for the batch-reading rsync to handle.  See also the --protocol option for a way to have the creating rsync generate a batch file that an older rsync can understand.  (Note that batch files changed format in version 2.6.3, so mixing versions older than that with newer versions will not work.)
When reading a batch file, rsync will force the value of certain options to match the data in the batch file if you didn't set them to the same as the batch-writing command.  Other options can (and should) be changed. For instance --write-batch changes to --read-batch, --files-from is dropped, and the --filter / --include / --exclude options are not needed unless one of the --delete options is specified.
The code that creates the BATCH.sh file transforms any filter/include/exclude options into a single list that is appended as a "here" document to the shell script file.  An advanced user can use this to modify the exclude list if a change in what gets deleted by --delete is desired.  A normal user can ignore this detail and just use the shell script as an easy way to run the appropriate --read-batch command for the batched data.
The original batch mode in rsync was based on "rsync+", but the latest version uses a new implementation.
Three basic behaviors are possible when rsync encounters a symbolic link in the source directory.
By default, symbolic links are not transferred at all.  A message "skipping non-regular" file is emitted for any symlinks that exist.
If --links is specified, then symlinks are recreated with the same target on the destination.  Note that --archive implies --links.
If --copy-links is specified, then symlinks are "collapsed" by copying their referent, rather than the symlink.
Rsync can also distinguish "safe" and "unsafe" symbolic links.  An example where this might be used is a web site mirror that wishes to ensure that the rsync module that is copied does not include symbolic links to /etc/passwd in the public section of the site.  Using --copy- unsafe-links will cause any links to be copied as the file they point to on the destination.  Using --safe-links will cause unsafe links to be omitted altogether. (Note that you must specify --links for --safe-links to have any effect.)
Symbolic links are considered unsafe if they are absolute symlinks (start with /), empty, or if they contain enough ".."  components to ascend from the directory being copied.
Here's a summary of how the symlink options are interpreted.  The list is in order of precedence, so if your combination of options isn't mentioned, use the first line that is a complete subset of your options:
--copy-links Turn all symlinks into normal files (leaving no symlinks for any other options to affect).
--links --copy-unsafe-links Turn all unsafe symlinks into files and duplicate all safe symlinks.
--copy-unsafe-links Turn all unsafe symlinks into files, noisily skip all safe symlinks.
--links --safe-links Duplicate safe symlinks and skip unsafe ones.
--links Duplicate all symlinks.
rsync occasionally produces error messages that may seem a little cryptic.  The one that seems to cause the most confusion is "protocol version mismatch -- is your shell clean?".
This message is usually caused by your startup scripts or remote shell facility producing unwanted garbage on the stream that rsync is using for its transport.  The way to diagnose this problem is to run your remote shell like this:
ssh remotehost /bin/true > out.dat
then look at out.dat.  If everything is working correctly then out.dat should be a zero length file.  If you are getting the above error from rsync then you will probably find that out.dat contains some text or data.  Look at the contents and try to work out what is producing it. The most common cause is incorrectly configured shell startup scripts (such as .cshrc or .profile) that contain output statements for non- interactive logins.
If you are having trouble debugging filter patterns, then try specifying the -vv option.  At this level of verbosity rsync will show why each individual file is included or excluded.
1      Syntax or usage error
2      Protocol incompatibility
3      Errors selecting input/output files, dirs
4      Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server.
5      Error starting client-server protocol
6      Daemon unable to append to log-file
10     Error in socket I/O
11     Error in file I/O
12     Error in rsync protocol data stream
13     Errors with program diagnostics
14     Error in IPC code
20     Received SIGUSR1 or SIGINT
21     Some error returned by waitpid()
22     Error allocating core memory buffers
23     Partial transfer due to error
24     Partial transfer due to vanished source files
25     The --max-delete limit stopped deletions
30     Timeout in data send/receive
35     Timeout waiting for daemon connection
CVSIGNORE The CVSIGNORE environment variable supplements any ignore patterns in .cvsignore files.  See the --cvs-exclude option for more details.
RSYNC_ICONV Specify a default --iconv setting using this environment variable. (First supported in 3.0.0.)
RSYNC_PROTECT_ARGS Specify a non-zero numeric value if you want the --protect-args option to be enabled by default, or a zero value to make sure that it is disabled by default. (First supported in 3.1.0.)
RSYNC_RSH The RSYNC_RSH environment variable allows you to override the default shell used as the transport for rsync.  Command line options are permitted after the command name, just as in the -e option.
RSYNC_PROXY The RSYNC_PROXY environment variable allows you to redirect your rsync client to use a web proxy when connecting to a rsync daemon. You should set RSYNC_PROXY to a hostname:port pair.
RSYNC_PASSWORD Setting RSYNC_PASSWORD to the required password allows you to run authenticated rsync connections to an rsync daemon without user intervention.  Note that this does not supply a password to a remote shell transport such as ssh; to learn how to do that, consult the remote shell's documentation.
USER or LOGNAME The USER or LOGNAME environment variables are used to determine the default username sent to an rsync daemon.  If neither is set, the username defaults to "nobody".
HOME   The HOME environment variable is used to find the user's default .cvsignore file.
/etc/rsyncd.conf or rsyncd.conf
rsync-ssl(1), rsyncd.conf(5)
times are transferred as *nix time_t values
When transferring to FAT filesystems rsync may re-sync unmodified files. See the comments on the --modify-window option.
file permissions, devices, etc. are transferred as native numerical values
see also the comments on the --delete option
Please report bugs! See the web site at https://rsync.samba.org/.
This man page is current for version 3.2.3 of rsync.
The options --server and --sender are used internally by rsync, and should never be typed by a user under normal circumstances.  Some awareness of these options may be needed in certain scenarios, such as when setting up a login that can only run an rsync command.  For instance, the support directory of the rsync distribution has an example script named rrsync (for restricted rsync) that can be used with a restricted ssh login.
rsync is distributed under the GNU General Public License.  See the file COPYING for details.
A web site is available at https://rsync.samba.org/.  The site includes an FAQ-O-Matic which may cover questions unanswered by this manual page.
We would be delighted to hear from you if you like this program.  Please contact the mailing-list at rsync@lists.samba.org.
This program uses the excellent zlib compression library written by Jean- loup Gailly and Mark Adler.
Special thanks go out to: John Van Essen, Matt McCutchen, Wesley W. Terpstra, David Dykstra, Jos Backus, Sebastian Krahmer, Martin Pool, and our gone-but-not-forgotten compadre, J.W. Schultz.
Thanks also to Richard Brent, Brendan Mackay, Bill Waite, Stephen Rothwell and David Bell.  I've probably missed some people, my apologies if I have.
rsync was originally written by Andrew Tridgell and Paul Mackerras.  Many people have later contributed to it. It is currently maintained by Wayne Davison.
Mailing lists for support and development are available at https://lists.samba.org/.
MOE(1)                            User Commands                           MOE(1)
moe - My Own (text) Editor
moe [global_options] [[+line[,col]] file_name [file_options]]...
GNU moe is a powerful, 8-bit clean, console text editor for ISO-8859 and ASCII character encodings. It has a modeless, user-friendly interface, online help, multiple windows, unlimited undo/redo capability, unlimited line length, unlimited buffers, global search/replace (on all buffers at once), block operations, automatic indentation, word wrapping, file name completion, directory browser, duplicate removal from prompt histories, delimiter matching, text conversion from/to UTF-8, romanization, etc.
Moe respects your work. By default it won't automatically add, change, or remove not even one byte in your files. Moe is a WYTIWYG (what you type is what you get) editor.
Moe can easily edit thousands of files at the same time.
Moe uses ISO-8859-15 instead of UTF-8 because an 8-bit character set (combined with romanization if needed) can convey meaning safely and more efficiently than UTF-8 can.
'global_options' are a mix of editor options and default 'file_options'. Most long option names have a negative form '--backup' '--no-backup'.
Each file name may be preceded by '+line[,column]' to start the cursor at the line, and optionally column, specified. 'line' and 'column' are applied to subsequent files until new values are specified for them.
'-' used as a file name argument means standard input.  Directories are recursively descended into.
Editor options: -h, --help display this help and exit
-1, --orphan put extra files in orphaned buffers
-b, --backup create backup files (default)
-B, --no-backup don't create backup files
-e, --exit-ask make save-and-close ask always for confirmation
-H, --smart-home go home, then go to first non-blank character
-i, --ignore-case make search case insensitive by default
-k, --keep-lines=<n> number of lines to keep for PgUp/PgDn
-m, --max-windows=<n> max number of windows to show at once
-n, --indent-step=<n> number of spaces to add when indenting a block
-s, --search-wrap make search wrap at end of file
-u, --auto-unmark turn off highlighting after block copy or move
-x, --rectangle rectangular block mode
File options: -a, --auto-indent enable auto indent
-l, --lmargin=<col> set left margin
-r, --rmargin=<col> set right margin
-o, --read-only make buffer read-only
-O, --overwrite disable insert mode
-w, --word-wrap enable word wrapping
-2, --two-spaces make reformat put two spaces after period
Exit status: 0 for a normal exit, 1 for environmental problems (invalid flags, I/O errors, etc), 2 to indicate an invalid or unreadable input file, 3 for an internal consistency error (eg, bug) which caused moe to panic.
Report bugs to bug-moe@gnu.org Moe home page: http://www.gnu.org/software/moe/moe.html General help using GNU software: http://www.gnu.org/gethelp
Copyright Â© 2021 Antonio Diaz Diaz.  License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent permitted by law.
The full documentation for moe is maintained as a Texinfo manual.  If the info and moe programs are properly installed at your site, the command
info moe
TRED(1)                      General Commands Manual                     TRED(1)
tred - transitive reduction filter for directed graphs
tred [ -vr?  ] [ files ]
tred computes the transitive reduction of directed graphs, and prints the resulting graphs to standard output.  This removes edges implied by transitivity.  Nodes and subgraphs are not otherwise affected.  The ``meaning'' and validity of the reduced graphs is application dependent. tred is particularly useful as a preprocessor to dot to reduce clutter in dense layouts.
Undirected graphs are silently ignored.
-r     Print information of removed edges to stderr.
Using bitmaps internally would substantially decrease running time.
If a graph has cycles, its transitive reduction is not uniquely defined. In this case tred emits a warning.
gc(1), dot(1), acyclic(1), gvpr(1), gvcolor(1), ccomps(1), sccmap(1), libgraph(3)
UL(1)                             User Commands                            UL(1)
ul - do underlining
ul [options] [file...]
ul reads the named files (or standard input if none are given) and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use, as specified by the environment variable TERM. The terminfo database is read to determine the appropriate sequences for underlining. If the terminal is incapable of underlining but is capable of a standout mode, then that is used instead. If the terminal can overstrike, or handles underlining automatically, ul degenerates to cat(1). If the terminal cannot underline, underlining is ignored.
-i, --indicated Underlining is indicated by a separate line containing appropriate dashes `-'; this is useful when you want to look at the underlining which is present in an nroff output stream on a crt-terminal.
-t, -T, --terminal terminal Override the environment variable TERM with the specified terminal type.
The following environment variable is used:
TERM The TERM variable is used to relate a tty device with its device capability description (see terminfo(5)). TERM is set at login time, either by the default terminal type specified in /etc/ttys or as set during the login process by the user in their login file (see setenv(3)).
The ul command appeared in 3.0BSD.
nroff usually outputs a series of backspaces and underlines intermixed with the text to indicate underlining. No attempt is made to optimize the backward motion.
colcrt(1), login(1), man(1), nroff(1), setenv(3), terminfo(5)
The ul command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
UUIDGEN(1)                        User Commands                       UUIDGEN(1)
uuidgen - create a new UUID value
uuidgen [options]
The uuidgen program creates (and prints) a new universally unique identifier (UUID) using the libuuid(3) library. The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future.
There are three types of UUIDs which uuidgen can generate: time-based UUIDs, random-based UUIDs, and hash-based UUIDs. By default uuidgen will generate a random-based UUID if a high-quality random number generator is present. Otherwise, it will choose a time-based UUID. It is possible to force the generation of one of these first two UUID types by using the --random or --time options.