1RDIST(1)                    General Commands Manual                   RDIST(1)
2
3
4

NAME

6       rdist - remote file distribution program
7

SYNOPSIS

9       rdist  [  -nqbRhivwy  ]  [ -f distfile ] [ -d var=value ] [ -m host ] [
10       name ... ]
11
12       rdist [ -nqbRhivwy ] -c name ... [login@]host[:dest]
13

DESCRIPTION

15       Rdist is a program to maintain identical copies of files over  multiple
16       hosts.  It preserves the owner, group, mode, and mtime of files if pos‐
17       sible and can update programs that are executing.  Rdist reads commands
18       from  distfile  to direct the updating of files and/or directories.  If
19       distfile is `-', the standard input  is  used.   If  no  -f  option  is
20       present, the program looks first for `distfile', then `Distfile' to use
21       as the input.  If no names are specified on  the  command  line,  rdist
22       will  update all of the files and directories listed in distfile.  Oth‐
23       erwise, the argument is taken to be the name of a file to be updated or
24       the label of a command to execute. If label and file names conflict, it
25       is assumed to be a label.  These may be used together  to  update  spe‐
26       cific files using specific commands.
27
28       The  -c  option  forces rdist to interpret the remaining arguments as a
29       small distfile.  The equivalent distfile is as follows.
30
31            ( name ... ) -> [login@]host
32                 install   [dest] ;
33
34
35       Other options:
36
37       -d     Define var to have value.  The -d option is used  to  define  or
38              override variable definitions in the distfile.  Value can be the
39              empty string, one name, or a list of names surrounded by  paren‐
40              theses and separated by tabs and/or spaces.
41
42       -m     Limit  which  machines  are to be updated. Multiple -m arguments
43              can be given to limit updates to a subset of  the  hosts  listed
44              the distfile.
45
46       -n     Print the commands without executing them. This option is useful
47              for debugging distfile.
48
49       -q     Quiet mode. Files that are being modified are  normally  printed
50              on standard output. The -q option suppresses this.
51
52       -R     Remove  extraneous  files.  If a directory is being updated, any
53              files that exist on the remote host that do  not  exist  in  the
54              master  directory  are  removed.  This is useful for maintaining
55              truely identical copies of directories.
56
57       -h     Follow symbolic links. Copy the file that  the  link  points  to
58              rather than the link itself.
59
60       -i     Ignore  unresolved  links.   Rdist will normally try to maintain
61              the link structure of files being transfered and warn  the  user
62              if all the links cannot be found.
63
64       -v     Verify that the files are up to date on all the hosts. Any files
65              that are out of date will be displayed  but  no  files  will  be
66              changed nor any mail sent.
67
68       -w     Whole  mode.  The whole file name is appended to the destination
69              directory name. Normally, only the last component of a  name  is
70              used  when  renaming  files.   This  will preserve the directory
71              structure of the files being copied instead  of  flattening  the
72              directory  structure. For example, renaming a list of files such
73              as ( dir1/f1 dir2/f2 ) to dir3 would create  files  dir3/dir1/f1
74              and dir3/dir2/f2 instead of dir3/f1 and dir3/f2.
75
76       -y     Younger mode. Files are normally updated if their mtime and size
77              (see stat(2)) disagree. The -y option causes rdist not to update
78              files  that  are younger than the master copy.  This can be used
79              to prevent newer copies on other hosts from being  replaced.   A
80              warning  message  is  printed for files which are newer than the
81              master copy.
82
83       -b     Binary comparison. Perform a binary comparison and update  files
84              if they differ rather than comparing dates and sizes.
85
86       Distfile  contains  a  sequence of entries that specify the files to be
87       copied, the destination hosts, and what operations to perform to do the
88       updating. Each entry has one of the following formats.
89
90            <variable name> `=' <name list>
91            [ label: ] <source list> `->' <destination list> <command list>
92            [ label: ] <source list> `::' <time_stamp file> <command list>
93
94       The  first format is used for defining variables.  The second format is
95       used for distributing files to other hosts.  The third format  is  used
96       for making lists of files that have been changed since some given date.
97       The source list specifies a list of files  and/or  directories  on  the
98       local  host  which  are to be used as the master copy for distribution.
99       The destination list is the list of hosts to which these files  are  to
100       be  copied.  Each file in the source list is added to a list of changes
101       if the file is out of date on the host which is being  updated  (second
102       format) or the file is newer than the time stamp file (third format).
103
104       Labels  are  optional.  They are used to identify a command for partial
105       updates.
106
107       Newlines, tabs, and blanks are only used as separators and  are  other‐
108       wise ignored. Comments begin with `#' and end with a newline.
109
110       Variables  to be expanded begin with `$' followed by one character or a
111       name enclosed in curly braces (see the examples at the end).
112
113       The source and destination lists have the following format:
114
115            <name>
116       or
117            `(' <zero or more names separated by white-space> `)'
118
119       The shell meta-characters `[', `]', `{', `}', `*', and `?'  are  recog‐
120       nized  and expanded (on the local host only) in the same way as csh(1).
121       They can be escaped with  a  backslash.   The  `~'  character  is  also
122       expanded in the same way as csh but is expanded separately on the local
123       and destination hosts.  When the -w option is used  with  a  file  name
124       that  begins with `~', everything except the home directory is appended
125       to the destination name.  File names which do not begin with `/' or `~'
126       use the destination user's home directory as the root directory for the
127       rest of the file name.
128
129       The command list consists of zero or more  commands  of  the  following
130       format.
131
132            `install'  <options>    opt_dest_name `;'
133            `notify'   <name list>  `;'
134            `except'   <name list>  `;'
135            `except_pat'            <pattern list>`;'
136            `special'  <name list>  string `;'
137
138
139       The  install  command is used to copy out of date files and/or directo‐
140       ries.  Each source file is copied to each host in the destination list.
141       Directories  are  recursively copied in the same way.  Opt_dest_name is
142       an optional parameter to rename files.  If no install  command  appears
143       in  the  command  list  or  the  destination name is not specified, the
144       source file name is used.  Directories in the path name will be created
145       if  they do not exist on the remote host.  To help prevent disasters, a
146       non-empty directory on a target host will never be replaced with a reg‐
147       ular  file  or  a symbolic link.  However, under the `-R' option a non-
148       empty directory will be removed if the corresponding filename  is  com‐
149       pletely  absent  on the master host.  The options are `-R', `-h', `-i',
150       `-v', `-w', `-y', and `-b' and have the same semantics  as  options  on
151       the  command  line  except  they  only apply to the files in the source
152       list.  The login name used on the destination host is the same  as  the
153       local host unless the destination name is of the format ``login@host".
154
155       The  notify  command is used to mail the list of files updated (and any
156       errors that may have occured) to the listed names.  If no  `@'  appears
157       in  the  name,  the  destination  host  is  appended to the name (e.g.,
158       name1@host, name2@host, ...).
159
160       The except command is used to update all of the  files  in  the  source
161       list except for the files listed in name list.  This is usually used to
162       copy everything in a directory except certain files.
163
164       The except_pat command is like the except command except  that  pattern
165       list  is a list of regular expressions (see ed(1) for details).  If one
166       of the patterns matches some string within a file name, that file  will
167       be  ignored.  Note that since `\' is a quote character, it must be dou‐
168       bled to become part of the regular expression.  Variables are  expanded
169       in  pattern  list  but  not shell file pattern matching characters.  To
170       include a `$', it must be escaped with `\'.
171
172       The special command is used to specify sh(1) commands that  are  to  be
173       executed  on  the remote host after the file in name list is updated or
174       installed.  If the name list is omitted then the shell commands will be
175       executed  for  every  file  updated  or  installed.  The shell variable
176       `FILE' is set to the current filename before executing the commands  in
177       string.   String  starts and ends with `"' and can cross multiple lines
178       in distfile.  Multiple commands to the shell  should  be  separated  by
179       `;'.   Commands  are  executed in the user's home directory on the host
180       being updated.  The special command can  be  used  to  rebuild  private
181       databases, etc.  after a program has been updated.
182
183       The following is a small example.
184
185            HOSTS = ( matisse root@arpa)
186
187            FILES = ( /bin /lib /usr/bin /usr/games
188                       /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}
189                       /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )
190
191            EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc
192                       sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont )
193
194            ${FILES} -> ${HOSTS}
195                       install -R ;
196                       except /usr/lib/${EXLIB} ;
197                       except /usr/games/lib ;
198                       special /usr/sbin/sendmail "/usr/sbin/sendmail -bz" ;
199
200            srcs:
201            /usr/src/bin -> arpa
202                       except_pat ( \\.o\$ /SCCS\$ ) ;
203
204            IMAGEN = (ips dviimp catdvi)
205
206            imagen:
207            /usr/local/${IMAGEN} -> arpa
208                       install /usr/local/lib ;
209                       notify ralph ;
210
211            ${FILES} :: stamp.cory
212                       notify root@cory ;
213
214

FILES

216       distfile       input command file
217       /tmp/rdist*    temporary file for update lists
218

SEE ALSO

220       sh(1), csh(1), stat(2)
221

DIAGNOSTICS

223       A  complaint  about  mismatch  of rdist version numbers may really stem
224       from some problem with starting your shell, e.g., you are in  too  many
225       groups.
226

BUGS

228       Source files must reside on the local host where rdist is executed.
229
230       There is no easy way to have a special command executed after all files
231       in a directory have been updated.
232
233       Variable expansion only works for name lists; there should be a general
234       macro facility.
235
236       Rdist aborts on files which have a negative mtime (before Jan 1, 1970).
237
238       There  should  be  a  `force'  option to allow replacement of non-empty
239       directories by regular files or symlinks.  A  means  of  updating  file
240       modes and owners of otherwise identical files is also needed.
241
242
243
2444.3 Berkeley Distribution      October 22, 1996                       RDIST(1)
Impressum