source: trunk/minix/man/man1/remsync.1@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

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