[9] | 1 | .TH REMSYNC 1
|
---|
| 2 | .SH NAME
|
---|
| 3 | remsync - remotely synchronize file trees
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | .B remsync
|
---|
| 6 | .B \-sxv
|
---|
| 7 | .I tree
|
---|
| 8 | .RI [ state-file ]
|
---|
| 9 | .br
|
---|
| 10 | .B remsync
|
---|
| 11 | .B \-duxvD
|
---|
| 12 | .I tree
|
---|
| 13 | .RI [ state-file
|
---|
| 14 | .RI [ diff-file ]]
|
---|
| 15 | .br
|
---|
| 16 | .B remsync
|
---|
| 17 | .RB [ \-xv ]
|
---|
| 18 | .I tree
|
---|
| 19 | .RI [ diff-file ]
|
---|
| 20 | .SH DESCRIPTION
|
---|
| 21 | .de SP
|
---|
| 22 | .if t .sp 0.4
|
---|
| 23 | .if n .sp
|
---|
| 24 | ..
|
---|
| 25 | .B Remsync
|
---|
| 26 | synchronizes file trees of distant machines, i.e. machines that do not have
|
---|
| 27 | a fast network between them. It accomplishes this in three steps:
|
---|
| 28 | .PP
|
---|
| 29 | .RS
|
---|
| 30 | Create a state file containing a description of the machine to be updated.
|
---|
| 31 | .RE
|
---|
| 32 | .PP
|
---|
| 33 | .RS
|
---|
| 34 | Compute a file of differences on the source machine using the state file to
|
---|
| 35 | compare the two file trees.
|
---|
| 36 | .RE
|
---|
| 37 | .PP
|
---|
| 38 | .RS
|
---|
| 39 | Update the target machine using the data in the differences file.
|
---|
| 40 | .RE
|
---|
| 41 | .PP
|
---|
| 42 | This process requires that you move two files, a state file from the target
|
---|
| 43 | machine to the source machine, and a differences file from the source
|
---|
| 44 | machine to the target machine. The state file is an ASCII file that may be
|
---|
| 45 | edited, usually to make
|
---|
| 46 | .B remsync
|
---|
| 47 | ignore some files or file trees.
|
---|
| 48 | .PP
|
---|
| 49 | The argument
|
---|
| 50 | .I tree
|
---|
| 51 | may be a single file or a directory. A directory is traversed recursively.
|
---|
| 52 | The
|
---|
| 53 | .I state-file
|
---|
| 54 | and
|
---|
| 55 | .I diff-file
|
---|
| 56 | arguments may be of any file type. The differences file contains an end
|
---|
| 57 | marker, so it may be followed by trailing junk. Standard input or
|
---|
| 58 | output is used if these arguments are omitted or replaced by a minus
|
---|
| 59 | sign.
|
---|
| 60 | .SS "State file format"
|
---|
| 61 | A state file has a line for each file in a tree. A line looks like this
|
---|
| 62 | formally for a simple file:
|
---|
| 63 | .PP
|
---|
| 64 | .RS
|
---|
| 65 | .I "name mode owner group length date"
|
---|
| 66 | .RI [ link-number
|
---|
| 67 | .RB [ last ]]
|
---|
| 68 | .RE
|
---|
| 69 | .PP
|
---|
| 70 | The best way to show how each type of file is represented is by example:
|
---|
| 71 | .PP
|
---|
| 72 | .RS
|
---|
| 73 | .nf
|
---|
| 74 | .ta +10 +8 +4 +4 +6 +12 +4
|
---|
| 75 | / d755 0 0
|
---|
| 76 | bin d755 2 0
|
---|
| 77 | .in +2
|
---|
| 78 | [ 644 2 0 233 759160857 1
|
---|
| 79 | cat 755 2 0 3772 768742021
|
---|
| 80 | test 755 2 0 233 759160857 1 last
|
---|
| 81 | .in -2
|
---|
| 82 | dev d755 0 0
|
---|
| 83 | .in +2
|
---|
| 84 | fd0 b666 0 0 200
|
---|
| 85 | console c600 10 0 400
|
---|
| 86 | sd2 b600 0 0 a02
|
---|
| 87 | fifo p700 2 0
|
---|
| 88 | .in -2
|
---|
| 89 | opt -> usr/opt
|
---|
| 90 | usr ignore (Cross-device link)
|
---|
| 91 | .fi
|
---|
| 92 | .RE
|
---|
| 93 | .PP
|
---|
| 94 | The root of the tree is always represented by a /, no matter what type of
|
---|
| 95 | file it may be. Directory entries of the root follow at the same level.
|
---|
| 96 | Files in subdirectories are indented by two spaces. (Eight spaces are
|
---|
| 97 | replaced by a TAB.) Normal files have their length and modified time in the
|
---|
| 98 | state file, devices have their device number in hex, etc. If files are hard
|
---|
| 99 | linked to each other then they all get an extra "link number" to bind them
|
---|
| 100 | together. The last link is marked with the word
|
---|
| 101 | .BR last .
|
---|
| 102 | .PP
|
---|
| 103 | One usually only modifies a state file to ignore differences between two
|
---|
| 104 | files. One does this by replacing the file attributes with the word
|
---|
| 105 | .BR ignore .
|
---|
| 106 | .RB ( Remsync
|
---|
| 107 | generates this keyword too, with the reason why added in parentheses.)
|
---|
| 108 | .SH OPTIONS
|
---|
| 109 | .TP
|
---|
| 110 | .B \-s
|
---|
| 111 | Generate a state file.
|
---|
| 112 | .TP
|
---|
| 113 | .B \-d
|
---|
| 114 | Generate a differences file. (The default is to apply a differences file.)
|
---|
| 115 | .TP
|
---|
| 116 | .B \-u
|
---|
| 117 | Only add new files or update files with newer versions.
|
---|
| 118 | .TP
|
---|
| 119 | .B \-x
|
---|
| 120 | Do not cross device boundaries. This allows one to operate on the root file
|
---|
| 121 | system for instance ignoring the
|
---|
| 122 | .B /usr
|
---|
| 123 | file system.
|
---|
| 124 | .TP
|
---|
| 125 | .B \-D
|
---|
| 126 | Debug differences file generation. With this flag no file contents are
|
---|
| 127 | added to the differences file. The result is then human readable.
|
---|
| 128 | .TP
|
---|
| 129 | .B \-v
|
---|
| 130 | Lists the commands added to the differences file, or the actions done
|
---|
| 131 | applying a differences file. The output looks like \s-2UNIX\s+2 commands
|
---|
| 132 | except for the words "add", "restore" and "update" indicating addition of a
|
---|
| 133 | new file, replacing a file with an older version, or replacement by a newer
|
---|
| 134 | version.
|
---|
| 135 | .SH EXAMPLES
|
---|
| 136 | Actions taken by the author to update his notebook "finiah" from his main
|
---|
| 137 | machine "darask":
|
---|
| 138 | .PP
|
---|
| 139 | .RS
|
---|
| 140 | .nf
|
---|
| 141 | finiah# remsync -s /usr /tmp/finiah.state
|
---|
| 142 | .SP
|
---|
| 143 | Edit the state file to ignore .Xauthority files and /usr/var.
|
---|
| 144 | .SP
|
---|
| 145 | finiah# tar cvf /dev/fd0 /tmp/finiah.state
|
---|
| 146 | .SP
|
---|
| 147 | darask# tar xvf /dev/fd0
|
---|
| 148 | .br
|
---|
| 149 | darask# remsync -dv /usr /tmp/finiah.state | vol 1440 /dev/fd0
|
---|
| 150 | .SP
|
---|
| 151 | finiah# vol 1440 /dev/fd0 | remsync -v /usr
|
---|
| 152 | .fi
|
---|
| 153 | .RE
|
---|
| 154 | .PP
|
---|
| 155 | One could add a file compression/decompression program between
|
---|
| 156 | .B remsync
|
---|
| 157 | and
|
---|
| 158 | .BR vol ,
|
---|
| 159 | to reduce the number of floppies to move about, but that actually slows
|
---|
| 160 | things down! (Note that one only needs to shuffle two floppies about if the
|
---|
| 161 | two machines are adjacent. To update a remote machine it does make sense to
|
---|
| 162 | use compression to reduce the number of floppies to carry.)
|
---|
| 163 | .SH "SEE ALSO"
|
---|
| 164 | .BR synctree (1),
|
---|
| 165 | .BR vol (1),
|
---|
| 166 | .BR tar (1).
|
---|
| 167 | .SH NOTES
|
---|
| 168 | Nothing stops you from using
|
---|
| 169 | .B remsync
|
---|
| 170 | over a fast network of course.
|
---|
| 171 | .B Synctree
|
---|
| 172 | can be a bit tedious if you only want to ignore a few files. Editing a
|
---|
| 173 | state file is then easier.
|
---|
| 174 | .SH BUGS
|
---|
| 175 | Files are overwritten, not removed, when they are updated. This means
|
---|
| 176 | that links outside the tree are also updated. The less desirable
|
---|
| 177 | alternative to this is to break the link before the update.
|
---|
| 178 | .PP
|
---|
| 179 | The verbose option may say that a link is to be created when making a
|
---|
| 180 | differences file. The link is often already there when the update takes
|
---|
| 181 | place, so no action is taken, and thus no talk about it. So you may miss a
|
---|
| 182 | few mutterings about links if you compare the messages.
|
---|
| 183 | .SH AUTHOR
|
---|
| 184 | Kees J. Bot (kjb@cs.vu.nl)
|
---|