rsync-dist.pl

Syntax: rsync-dist.pl {options} [command]

Glossary of common command arguments:
  MODE       MODE specifies weather a command works on the distibution of
             link directory. MODE must be "dist", "d", "links" or "l".
  VERSION    The name of a sub directory in the distribution or "dist"
             directory. Each time you run the "dist" command, a new directory
             in the distribution directory is created. It's name is created
             from the date and time you ran the "dist" command.
  LINK       The name of a symbolic link that refers to a VERSION. All LINKs
             are created in the "links" directory.
  LINKGLOB   A file glob expression that is used to match more than one LINK
             at once. For example "IOC*" could be used to match the links
             "IOC1", "IOC2" and "IOC3".
  BRANCH     A branch name used for distributing a new VERSION. When you
             often distribute versions that do not always have much in common
             they will take up more space on the server. Branches can be used
             to group versions that have much in common. A typical use case
             would be if you distribute versions either for the Linux or the
             RTEMS operating system. Then you would create one branch for
             Linux and one for RTEMS since diretories of these two groups
             will have much in common so disk space on the server can be
             saved.
  SOURCEBRANCH
             Just the name of another branch where you start diverting from
             with a new BRANCH.
  TAG        A short string, often without spaces that is used to give a name
             to a VERSION. 
  REGEXP     A grep compatible regular expression that is used for some
             commands instead of a constant fixed string-
  FILENAME   Just the name of a file.
  HOST       A name of a remote host where the distribution and links
             directories exist.
  USER       The name of a user on the remote host.
  COMMAND    An arbitrary command.
  SSH_COMMAND
             A complete command line for logging onto another host with ssh.
  ABS_DIR    An absolute directory path.
  PATH       A file or directory path that not always needs to be absolute.
  DIR_PREFIX A prefix to a PATH that creates an absolute file or directory
             path.
  LOGMESSAGE An arbitrate string that is used to create a log message in the
             log file.
  EDITOR     A command that starts a text editor.
  TUNNELMODE A mode for the reverse ssh tunnel. Either "exists", then an
             existing ssh tunnel is used, or "create", then the tunnel is
             created and destroyed after usage.
  PORT       A tcp/ip port number.

commands that do changes on the server:

  dist       Distribute files to remote host

  to-attic   VERSION
             Move directory with name VERSION  to the "attic" directory.

  from-attic VERSION
             Move a directory with name VERSION from the "attic" directory
             back to the main directory (which is given by --distpath or
             RSYNC_DIST_PATH.

  change-links [VERSION,]LINKGLOB|LINK[,LINK...]
             Change symbolic links on the remote server. When
             --prefix-distdir (or RSYNC_DIST_PREFIX_DISTDIR) and --last-dist
             are set, the 'VERSION' argument must not be given. Otherwise it is
             mandatory. 
              --> see also "--last-dist".

  add-links [VERSION,]LINKGLOB|LINK[,LINK...]
             Add links on the remote server. When --prefix-distdir (or
             RSYNC_DIST_PREFIX_DISTDIR) and --last-dist are set, the
             'source' argument must not be given. Otherwise it is mandatory.
             --> see also "--last-dist"

  remove-links LINKGLOB|LINK[,LINK...]
             Remove links on the remote server.

  mirror MODE
             Mirror the specified directory from the first given host to all
             following ones. Caution: you may delete data on the secondary
             hosts that you wanted to keep, think twice before running this
             command The list of mirror-hosts may contain the directory in
             the form "hostname/directory". With this it is possible to
             distribute directories from the central mirror (the first host
               in the list) to a different directory on the other host. If
             the directory is not given (no "/" is found in the hostname) it
             is the same as on the central mirror

  rm-lock MODE
             Remove the lockfile in the "dist" or "links" directory in case
             it was left behind due to an error in the script. 

  force-rm-lock MODE
             Like "rm-lock", but the lock file is removed even when it was
             created by another user. 

  mk-lock MODE
             Create the lockfile in the remote directory. This is useful in
             order to lock the directory for other users that run
             rsync-dist.pl when you want to modify files on the remote-host
             manually.

  rebuild-last
             Rebuild the "LAST" file on the remote server. This file contains
             VERSION, the name of last created distribution directory. When a
             new distribution is made, the files are compared against the
             files of this directory. When a file has not changed, a
             hard-link to this directory is created. Note that this command
             creates no lock-file on the remote host. You have to do this
             yourself with the "--mk-lock" command before. only for
             distribution directories.

  create-branch BRANCH[,SOURCEBRANCH]
              create a new branch on the server. The SOURCEBRANCH parameter
              is optional. It is the name of the old branch from which new
              branch is created. If SOURCEBRANCH is omitted, the branch is
              created from the default branch.

  expand-glob
              if the --localpath parameter contains glob-expressions
              list all the files that would be checked for transfer
              when a dist command is issued

commands to inspect the server:

  ls --ls MODE
              Show the remote directory. 

  cat-log MODE
              Show the logfile. 


  tail-log MODE
              Show the last n lines of the logfile (for distribution or
              links). The default for n is 20 but it can be specified
              differently with option --lines.

  perl-log MODE
              Similar to --cat-log, but dump the logfile as a perl-structure
              to the screen.

  python-log MODE
              Similar to --cat-log, but dump the logfile as a
              python-structure to the screen.

  ls-tag TAG|REGEXP
              Search for a tag in the log file only for distribution
              directories.

  ls-version VERSION|REGEXP
              Search for a version in the log file, works only with this
              distribution directory.

  cat-changes MODE
              Show the changes-file.

  tail-changes MODE
              Show the last n lines of the changes-file. The default for n is
              20 but it can be specified differently with option --lines.


commands for the config-file:

  show-config 
              Print the contents of a valid configuration file to the screen.
              You can for example create a configuration file by supplying
              --hosts, --user, --distpath, --linkpath and --localpath on the
              command-line and additionally --show-config. The program will
              then print a generated configuration-file to the console. If
              you redirect this to a file you have your configuration file.

  write-config FILENAME
              Like --show-config but write to a file.

  show-config-from-log
              Similar to --show-config, but in this case the program also
              reads the local log-file to get information on the remote-host,
              the remote-user and the remote paths.

  write-config-from-log FILENAME
              Like --show-config-from-log but write to a file.


help options:
  -h: this help

  --man: show embedded manpage

  --summary:  give a summary of the script

options to specify remote host and user:

  -H, --host HOST[,HOST...]
             A list of remote-hosts separated by comma, spaces, or colon. If
             this option is not given the script tries to read from the
             environment variable "RSYNC_DIST_HOST".

  -u, --user USER[,USER...]
              User for login on the remote host. if this option is not given
              the script tries to read from the environment variable
              "RSYNC_DIST_USER"

options to specify the ssh command:

  --ssh-local SSH_COMMAND
              The way ssh from the local host is started can be overridden this way.
  --ssh-remote SSH_COMMAND
              The way ssh from the remote host is started can be overridden this way.

options to specify directories:

  -p, --distpath ABS_DIR
              Remote directory where files are disted. if this option is not
              given the script tries to read from the environment variable
              "RSYNC_DIST_PATH".

  -P, --linkpath ABS_DIR
              Remote directory where links are created. If this option is not
              given the script tries to read from the environment variable
              "RSYNC_DIST_LINKPATH".

  -l, --localpath PATH[,PATH...]
              List of files or directories to be distributed. If this option
              is not given the script tries to read from the environment
              variable "RSYNC_DIST_LOCALPATH" Several paths can be specified
              with either a comma-separated list or several -l options. If a
              localpath contains a single dot like in "build/./bin",
              rsync-dist will only create the directory or directories
              *after* the dot on the target hosts. In the example above, the
              local directory "build/bin" would be installed as "bin".

  --localprefix DIR_PREFIX
              Prepended to all files or directories to be distributed. If
              this option is not given the script tries to read from the
              environment variable "RSYNC_DIST_LOCALPREFIX".

Options to specify tags and log-messages:

  -m, --message LOGMESSAGE
              Specify a log message. If this option is not given the script
              tries to read from the environment variable
              "RSYNC_DIST_MESSAGE" if this option is given without being
              followed by a message, an empty log-message is used.

  --automessage
              (only for the "add-links" or "change-links" commannds)
              Generate a message of the style "link to [tag]" where [tag] is
              the tag of the last distributed version. This is an alternative
              to the "--message" option

  -t, --tag TAG
              Define a tag for the distributed VERSION. If this option is not
              given the script tries to read from the environment variable
              "RSYNC_DIST_TAG" if this option is given without being followed
              by a tag-string, an empty tag is used

  --autotag   (only for the "dist" command)
              Take the TAG from the last distributed version and increment
              the number at the end of this tag by one. This is an
              alternative to the "--tag" option

Options for the management of pre-defined parameters:

  -c, --config FILENAME
              Read variables from a configuration file. The format is simple
              <name>=<value> Empty lines and lines starting with "#" are
              ignored. Spaces around the "=" sign are also ignored. Array
              values are specified as comma-separated lists. All variable
              names correspond with a command line option and can also be
              specified this way. For a list of all known variables run
              'rsync-dist.pl --man' and look for section 'Configuration file
              variables'. Note that command-line arguments always override
              values taken from the config-file.

  --env       By supplying this option, the program can take all variables
              mentioned above (see --config) from the unix-shell environment.

miscellaneous options:

  --short-date
              Usually the directory created by command 'dist' has a strict
              ISO Datetime format YYYY-MM-DDTHH:mm:SS. With this option, the
              colons are omitted so the directory created is
              YYYY-MM-DDTHHmmSS. Note that this is no longer conform with the
              ISO 8601 standard.

  --branch BRANCH
              Use the most recent version of <branchname> to make the
              hardlink-copy on the server.

  --partial   Make a complete copy of the last version on the server but
              distribute only some files from the client to the server.
              --localpath may contain file-glob patterns.

  --filter-output
              When this option is given, output from remote ssh commands is
              filtered to make it more human readable. This affects the
              commands "change-links", "add-links", and "ls links".

  --version-file [filename]
              When the <dist> command is executed, the name of the directory
              that is created on the server is written to this file.

              Note that the filename may be a complete path+filename. If the
              path is not absolute, it is assumed to be relative to
              localprefix. If localprefix is not specified, it is assumed to
              be relative to the current working directory. Note too, that
              the file may be created in one of the directories that is to be
              distributed. This is done before the actual transfer of files
              takes place, so you will find the generated file on the server
              too, in this case.

  --editor EDITOR
              Specify the interactive editor. if this option is not given the
              script tries to read from the environment variable
              "RSYNC_DIST_EDITOR", if this is not set from "EDITOR", if this
              is not set the default is "vi" Note that these
              environment variables are even if "--env" (see above) is not
              given

  -N, --no-editor-defaults
              Do not show defaults for the text-entries when the editor is
              called.

  --no-no-editor-defaults
              Set "--no-editor-defaults" (see above) to false (use editor
                defaults). Since this is the default behavior, this option is
              only needed in order to override a different setting taken from
              a config file.

  --prefix-distdir
              If empty or '1', prepend the distribution directory to the
              link-source path. If this is a non-empty string prepend this to
              the link source path. This effects only the connamds
              'add-links' and 'change-links'. Together with --last-dist you
              can specify the "source" part completely like it is shown here:
                rsync-dist.pl --config my_config --prefix-distdir 1 
                              --last-dist change-links idcp*

              and here:

                rsync-dist.pl --config my_config --prefix-distdir 1 
                              --last-dist change-links idcp1,idcp2

  -L, --last-dist
              Use the source name of the last distribution for the add-links,
              change-links or to-attic commands. made to the "source" part of
              the add-links, change-links, or to-attic commands.

  --one-filesystem
              Do not cross filesystem boundaries on the local host

  --preserve-links
              Never dereference links, just keep them.

  --dereference-links
              Always dereference links.

  --exclude-list [file]
              Specify a file that contains files to be excluded from transfer.

  --checksum  defunct option, retained for compatibility

  --lines LINES
              Specify the number of lines to print for commands tail-log and
              tail-changes.

  --progress  Use the rsync "progress" option to show the progress of rsync
              on screen.

  --dry-run   Just show the command that would be executed.

  -w, --world-readable
              Make all files world-readable.

  --postproc COMMAND
              Run the argument as a command on the target host after dist;
              the working directory is the newly created version.

  --link-postproc COMMAND
              Run the argument as a command on the target host after
              add-links or change-links; the working directory is the link's
              (new) target; the link names can be accessed by the command via
              the environment variable RSYNC_DIST_LINK_NAMES.

  --create_missing_links
              For use with command "change-links": don't complain if links
              don't exist, instead create them.

  --ssh-reverse-tunnel-mode TUNNELMODE
              If given, use a ssh reverse tunnel to connect from the server
              back to the local host. Depending on TUNNELMODE the program
              either uses an existing reverse tunnel or creates a reverse
              tunnel and destroys it after usage.
              If a reverse tunnel is created, this is done with the following
              command:

                  ssh -R <port>:localhost:22 <remote-user>@<remote-host>

              See also --ssh-reverse-tunnel-port. This option may also be set
              by the environment variable RSYNC_DIST_SSH_REVERSE_TUNNEL_MODE.

  --ssh-reverse-tunnel-port PORT
              When reverse tunnel mode is set (see --ssh-reverse-tunnel-mode)
              use this port for the reverse tunnel on the remote server. The
              must be *no other* application using this port on the remote
              server. The default for this port is
              53591. This option may also be set
              by the environment variable RSYNC_DIST_SSH_REVERSE_TUNNEL_PORT.

  --single-host
              Perform "ls" or "cat-log" or "tail-log" command
              only on the first remote host.