1RDIST(1) 386BSD Reference Manual RDIST(1) 2 3NNAAMMEE 4 rrddiisstt - remote file distribution program 5 6SSYYNNOOPPSSIISS 7 rrddiisstt [--nnqqbbRRhhiivvwwyy] [--ff _d_i_s_t_f_i_l_e] [--dd _v_a_r=_v_a_l_u_e] [--mm --hhoosstt] [_n_a_m_e ...] 8 rrddiisstt [--nnqqbbRRhhiivvwwyy] --cc _n_a_m_e ... [login@]_h_o_s_t[:dest] 9 10DDEESSCCRRIIPPTTIIOONN 11 RRddiisstt is a program to maintain identical copies of files over multiple 12 hosts. It preserves the owner, group, mode, and mtime of files if 13 possible and can update programs that are executing. RRddiisstt reads 14 commands from _d_i_s_t_f_i_l_e to direct the updating of files and/or 15 directories. 16 17 Options specific to the first SYNOPSIS form: 18 19 -- If _d_i_s_t_f_i_l_e is `--', the standard input is used. 20 21 --ff _d_i_s_t_f_i_l_e 22 Use the specified _d_i_s_t_f_i_l_e. 23 24 If either the --ff or `--' option is not specified, the program looks first 25 for ``_d_i_s_t_f_i_l_e'', then ``_D_i_s_t_f_i_l_e'' to use as the input. If no names are 26 specified on the command line, rrddiisstt will update all of the files and 27 directories listed in _d_i_s_t_f_i_l_e. Otherwise, the argument is taken to be 28 the name of a file to be updated or the label of a command to execute. If 29 label and file names conflict, it is assumed to be a label. These may be 30 used together to update specific files using specific commands. 31 32 Options specific to the second SYNOPSIS form: 33 34 --cc Forces rrddiisstt to interpret the remaining arguments as a small 35 _d_i_s_t_f_i_l_e. 36 37 The equivalent distfile is as follows. 38 39 (_n_a_m_e ...) -> [_l_o_g_i_n@] _h_o_s_t 40 install [_d_e_s_t]; 41 42 Options common to both forms: 43 44 --bb Binary comparison. Perform a binary comparison and update 45 files if they differ rather than comparing dates and sizes. 46 47 --dd _v_a_r=_v_a_l_u_e 48 Define _v_a_r to have _v_a_l_u_e. The --dd option is used to define or 49 override variable definitions in the _d_i_s_t_f_i_l_e. _V_a_l_u_e can be 50 the empty string, one name, or a list of names surrounded by 51 parentheses and separated by tabs and/or spaces. 52 53 --hh Follow symbolic links. Copy the file that the link points to 54 rather than the link itself. 55 56 --ii Ignore unresolved links. RRddiisstt will normally try to maintain 57 the link structure of files being transfered and warn the 58 user if all the links cannot be found. 59 60 --mm _h_o_s_t Limit which machines are to be updated. Multiple --mm arguments 61 can be given to limit updates to a subset of the hosts listed 62 the _d_i_s_t_f_i_l_e. 63 64 --nn Print the commands without executing them. This option is 65 66 useful for debugging _d_i_s_t_f_i_l_e. 67 68 --qq Quiet mode. Files that are being modified are normally 69 printed on standard output. The --qq option suppresses this. 70 71 --RR Remove extraneous files. If a directory is being updated, any 72 files that exist on the remote host that do not exist in the 73 master directory are removed. This is useful for maintaining 74 truely identical copies of directories. 75 76 --vv Verify that the files are up to date on all the hosts. Any 77 files that are out of date will be displayed but no files 78 will be changed nor any mail sent. 79 80 --ww Whole mode. The whole file name is appended to the 81 destination directory name. Normally, only the last component 82 of a name is used when renaming files. This will preserve 83 the directory structure of the files being copied instead of 84 flattening the directory structure. For example, renaming a 85 list of files such as ( dir1/f1 dir2/f2 ) to dir3 would 86 create files dir3/dir1/f1 and dir3/dir2/f2 instead of dir3/f1 87 and dir3/f2. 88 89 --yy Younger mode. Files are normally updated if their _m_t_i_m_e and 90 _s_i_z_e (see stat(2)) disagree. The --yy option causes rrddiisstt not 91 to update files that are younger than the master copy. This 92 can be used to prevent newer copies on other hosts from being 93 replaced. A warning message is printed for files which are 94 newer than the master copy. 95 96 _D_i_s_t_f_i_l_e contains a sequence of entries that specify the files to be 97 copied, the destination hosts, and what operations to perform to do the 98 updating. Each entry has one of the following formats. 99 100 <variable name> `=' <name list> 101 [label:]<source list> `->' <destination list> <command list> 102 [label:]<source list> `::' <time_stamp file> <command list> 103 104 The first format is used for defining variables. The second format is 105 used for distributing files to other hosts. The third format is used for 106 making lists of files that have been changed since some given date. The 107 _s_o_u_r_c_e _l_i_s_t specifies a list of files and/or directories on the local 108 host which are to be used as the master copy for distribution. The 109 _d_e_s_t_i_n_a_t_i_o_n _l_i_s_t is the list of hosts to which these files are to be 110 copied. Each file in the source list is added to a list of changes if 111 the file is out of date on the host which is being updated (second 112 format) or the file is newer than the time stamp file (third format). 113 114 Labels are optional. They are used to identify a command for partial 115 updates. 116 117 Newlines, tabs, and blanks are only used as separators and are otherwise 118 ignored. Comments begin with `#' and end with a newline. 119 120 Variables to be expanded begin with `$' followed by one character or a 121 name enclosed in curly braces (see the examples at the end). 122 123 The source and destination lists have the following format: 124 125 <name> 126 or 127 `(' <zero or more names separated by white-space> `)' 128 129 The shell meta-characters `[', `]', `{', `}', `*', and `?' are 130 recognized and expanded (on the local host only) in the same way as 131 csh(1). They can be escaped with a backslash. The `~' character is also 132 expanded in the same way as csh(1) but is expanded separately on the 133 local and destination hosts. When the --ww option is used with a file name 134 that begins with `~', everything except the home directory is appended to 135 the destination name. File names which do not begin with `/' or `~' use 136 the destination user's home directory as the root directory for the rest 137 of the file name. 138 139 The command list consists of zero or more commands of the following 140 format. 141 142 `install' <options> opt_dest_name `;' 143 `notify' <name list> `;' 144 `except' <name list> `;' 145 `except_pat' <pattern list> `;' 146 `special' <name list> string `;' 147 148 The iinnssttaallll command is used to copy out of date files and/or directories. 149 Each source file is copied to each host in the destination list. 150 Directories are recursively copied in the same way. _O_p_t__d_e_s_t__n_a_m_e is an 151 optional parameter to rename files. If no iinnssttaallll command appears in the 152 command list or the destination name is not specified, the source file 153 name is used. Directories in the path name will be created if they do 154 not exist on the remote host. To help prevent disasters, a non-empty 155 directory on a target host will never be replaced with a regular file or 156 a symbolic link. However, under the `-R' option a non-empty directory 157 will be removed if the corresponding filename is completely absent on the 158 master host. The _o_p_t_i_o_n_s are `-R', `-h', `-i', `-v', `-w', `-y', and 159 `-b' and have the same semantics as options on the command line except 160 they only apply to the files in the source list. The login name used on 161 the destination host is the same as the local host unless the destination 162 name is of the format ``login@host". 163 164 The nnoottiiffyy command is used to mail the list of files updated (and any 165 errors that may have occured) to the listed names. If no `@' appears in 166 the name, the destination host is appended to the name (e.g., name1@host, 167 name2@host, ...). 168 169 The eexxcceepptt command is used to update all of the files in the source list 170 eexxcceepptt for the files listed in _n_a_m_e _l_i_s_t. This is usually used to copy 171 everything in a directory except certain files. 172 173 The eexxcceepptt__ppaatt command is like the eexxcceepptt command except that _p_a_t_t_e_r_n 174 _l_i_s_t is a list of regular expressions (see ed(1) for details). If one of 175 the patterns matches some string within a file name, that file will be 176 ignored. Note that since `\' is a quote character, it must be doubled to 177 become part of the regular expression. Variables are expanded in _p_a_t_t_e_r_n 178 _l_i_s_t but not shell file pattern matching characters. To include a `$', 179 it must be escaped with `\'. 180 181 The ssppeecciiaall command is used to specify sh(1) commands that are to be 182 executed on the remote host after the file in _n_a_m_e _l_i_s_t is updated or 183 installed. If the _n_a_m_e _l_i_s_t is omitted then the shell commands will be 184 executed for every file updated or installed. The shell variable `FILE' 185 is set to the current filename before executing the commands in _s_t_r_i_n_g. 186 _S_t_r_i_n_g starts and ends with `"' and can cross multiple lines in _d_i_s_t_f_i_l_e. 187 Multiple commands to the shell should be separated by `;'. Commands are 188 executed in the user's home directory on the host being updated. The 189 _s_p_e_c_i_a_l command can be used to rebuild private databases, etc. after a 190 program has been updated. 191 192 The following is a small example: 193 194 HOSTS = ( matisse root@arpa ) 195 196 FILES = ( /bin /lib /usr/bin /usr/games 197 /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h} 198 /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist ) 199 200 EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc 201 sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont ) 202 203 ${FILES} -> ${HOSTS} 204 install -R ; 205 except /usr/lib/${EXLIB} ; 206 except /usr/games/lib ; 207 special /usr/lib/sendmail "/usr/lib/sendmail -bz" ; 208 209 srcs: 210 /usr/src/bin -> arpa 211 except_pat ( \\.o\$ /SCCS\$ ) ; 212 213 IMAGEN = (ips dviimp catdvi) 214 215 imagen: 216 /usr/local/${IMAGEN} -> arpa 217 install /usr/local/lib ; 218 notify ralph ; 219 220 ${FILES} :: stamp.cory 221 notify root@cory ; 222 223FFIILLEESS 224 distfile input command file 225 /tmp/rdist* temporary file for update lists 226 227SSEEEE AALLSSOO 228 sh(1), csh(1), stat(2) 229 230HHIISSTTOORRYY 231 The rrddiisstt command appeared in 4.3BSD. 232 233DDIIAAGGNNOOSSTTIICCSS 234 A complaint about mismatch of rdist version numbers may really stem from 235 some problem with starting your shell, e.g., you are in too many groups. 236 237BBUUGGSS 238 Source files must reside on the local host where rrddiisstt is executed. 239 240 There is no easy way to have a special command executed after all files 241 in a directory have been updated. 242 243 Variable expansion only works for name lists; there should be a general 244 macro facility. 245 246 RRddiisstt aborts on files which have a negative mtime (before Jan 1, 1970). 247 248 There should be a `force' option to allow replacement of non-empty 249 directories by regular files or symlinks. A means of updating file modes 250 and owners of otherwise identical files is also needed. 251 2524.3 Berkeley Distribution July 27, 1991 4 253 254 255 256 257 258 259 260 261 262 263 264 265