180 lines
6.6 KiB
HTML
180 lines
6.6 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>remsync(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>remsync(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
remsync - remotely synchronize file trees
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>remsync</STRONG> <STRONG>-sxv</STRONG> <EM>tree</EM> [<EM>state</EM>-<EM>file</EM>]
|
|
<STRONG>remsync</STRONG> <STRONG>-duxvD</STRONG> <EM>tree</EM> [<EM>state</EM>-<EM>file</EM> [<EM>diff</EM>-<EM>file</EM>]]
|
|
<STRONG>remsync</STRONG> [<STRONG>-xv</STRONG>] <EM>tree</EM> [<EM>diff</EM>-<EM>file</EM>]
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
<STRONG>Remsync</STRONG> synchronizes file trees of distant machines, i.e. machines that
|
|
do not have a fast network between them. It accomplishes this in three
|
|
steps:
|
|
|
|
Create a state file containing a description of the machine to be
|
|
updated.
|
|
|
|
Compute a file of differences on the source machine using the state
|
|
file to compare the two file trees.
|
|
|
|
Update the target machine using the data in the differences file.
|
|
|
|
This process requires that you move two files, a state file from the
|
|
target machine to the source machine, and a differences file from the
|
|
source machine to the target machine. The state file is an ASCII file
|
|
that may be edited, usually to make <STRONG>remsync</STRONG> ignore some files or file
|
|
trees.
|
|
|
|
The argument <EM>tree</EM> may be a single file or a directory. A directory is
|
|
traversed recursively. The <EM>state</EM>-<EM>file</EM> and <EM>diff</EM>-<EM>file</EM> arguments may be of
|
|
any file type. The differences file contains an end marker, so it may be
|
|
followed by trailing junk. Standard input or output is used if these
|
|
arguments are omitted or replaced by a minus sign.
|
|
|
|
<STRONG>State</STRONG> <STRONG>file</STRONG> <STRONG>format</STRONG>
|
|
A state file has a line for each file in a tree. A line looks like this
|
|
formally for a simple file:
|
|
|
|
<EM>name</EM> <EM>mode</EM> <EM>owner</EM> <EM>group</EM> <EM>length</EM> <EM>date</EM> [<EM>link</EM>-<EM>number</EM> [<STRONG>last</STRONG>]]
|
|
|
|
The best way to show how each type of file is represented is by example:
|
|
|
|
/ d755 0 0
|
|
bin d755 2 0
|
|
[ 644 2 0 233 759160857 1
|
|
cat 755 2 0 3772 768742021
|
|
test 755 2 0 233 759160857 1 last
|
|
dev d755 0 0
|
|
fd0 b666 0 0 200
|
|
console c600 10 0 400
|
|
sd2 b600 0 0 a02
|
|
fifo p700 2 0
|
|
opt -> usr/opt
|
|
usr ignore (Cross-device link)
|
|
|
|
The root of the tree is always represented by a /, no matter what type of
|
|
file it may be. Directory entries of the root follow at the same level.
|
|
Files in subdirectories are indented by two spaces. (Eight spaces are
|
|
replaced by a TAB.) Normal files have their length and modified time in
|
|
the state file, devices have their device number in hex, etc. If files
|
|
are hard linked to each other then they all get an extra "link number" to
|
|
bind them together. The last link is marked with the word <STRONG>last</STRONG>.
|
|
|
|
One usually only modifies a state file to ignore differences between two
|
|
files. One does this by replacing the file attributes with the word
|
|
<STRONG>ignore</STRONG>. (<STRONG>Remsync</STRONG> generates this keyword too, with the reason why added
|
|
in parentheses.)
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-s</STRONG> Generate a state file.
|
|
|
|
<STRONG>-d</STRONG> Generate a differences file. (The default is to apply a differences
|
|
file.)
|
|
|
|
<STRONG>-u</STRONG> Only add new files or update files with newer versions.
|
|
|
|
<STRONG>-x</STRONG> Do not cross device boundaries. This allows one to operate on the
|
|
root file system for instance ignoring the <STRONG>/usr</STRONG> file system.
|
|
|
|
<STRONG>-D</STRONG> Debug differences file generation. With this flag no file contents
|
|
are added to the differences file. The result is then human
|
|
readable.
|
|
|
|
<STRONG>-v</STRONG> Lists the commands added to the differences file, or the actions
|
|
done applying a differences file. The output looks like UNIX
|
|
commands except for the words "add", "restore" and "update"
|
|
indicating addition of a new file, replacing a file with an older
|
|
version, or replacement by a newer version.
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
Actions taken by the author to update his notebook "finiah" from his main
|
|
machine "darask":
|
|
|
|
finiah# remsync -s /usr /tmp/finiah.state
|
|
|
|
Edit the state file to ignore .Xauthority files and /usr/var.
|
|
|
|
finiah# tar cvf /dev/fd0 /tmp/finiah.state
|
|
|
|
darask# tar xvf /dev/fd0
|
|
darask# remsync -dv /usr /tmp/finiah.state | vol 1440 /dev/fd0
|
|
|
|
finiah# vol 1440 /dev/fd0 | remsync -v /usr
|
|
|
|
One could add a file compression/decompression program between <STRONG>remsync</STRONG>
|
|
and <STRONG>vol</STRONG>, to reduce the number of floppies to move about, but that
|
|
actually slows things down! (Note that one only needs to shuffle two
|
|
floppies about if the two machines are adjacent. To update a remote
|
|
machine it does make sense to use compression to reduce the number of
|
|
floppies to carry.)
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/synctree.1.html">synctree(1)</A></STRONG>, <STRONG><A HREF="../man1/vol.1.html">vol(1)</A></STRONG>, <STRONG><A HREF="../man1/tar.1.html">tar(1)</A></STRONG>.
|
|
|
|
|
|
</PRE>
|
|
<H2>NOTES</H2><PRE>
|
|
Nothing stops you from using <STRONG>remsync</STRONG> over a fast network of course.
|
|
<STRONG>Synctree</STRONG> can be a bit tedious if you only want to ignore a few files.
|
|
Editing a state file is then easier.
|
|
|
|
|
|
</PRE>
|
|
<H2>BUGS</H2><PRE>
|
|
Files are overwritten, not removed, when they are updated. This means
|
|
that links outside the tree are also updated. The less desirable
|
|
alternative to this is to break the link before the update.
|
|
|
|
The verbose option may say that a link is to be created when making a
|
|
differences file. The link is often already there when the update takes
|
|
place, so no action is taken, and thus no talk about it. So you may miss
|
|
a few mutterings about links if you compare the messages.
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Kees J. Bot (kjb@cs.vu.nl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|