📄 remsync.1
字号:
.TH REMSYNC 1.SH NAMEremsync - remotely synchronize file trees.SH SYNOPSIS.B remsync.B \-sxv.I tree.RI [ state-file ].br.B remsync.B \-duxvD.I tree.RI [ state-file.RI [ diff-file ]].br.B remsync.RB [ \-xv ].I tree.RI [ diff-file ].SH DESCRIPTION.de SP.if t .sp 0.4.if n .sp...B Remsyncsynchronizes file trees of distant machines, i.e. machines that do not havea fast network between them. It accomplishes this in three steps:.PP.RSCreate a state file containing a description of the machine to be updated..RE.PP.RSCompute a file of differences on the source machine using the state file tocompare the two file trees..RE.PP.RSUpdate the target machine using the data in the differences file..RE.PPThis process requires that you move two files, a state file from the targetmachine to the source machine, and a differences file from the sourcemachine to the target machine. The state file is an ASCII file that may beedited, usually to make.B remsyncignore some files or file trees..PPThe argument.I treemay be a single file or a directory. A directory is traversed recursively.The.I state-fileand.I diff-filearguments may be of any file type. The differences file contains an endmarker, so it may be followed by trailing junk. Standard input oroutput is used if these arguments are omitted or replaced by a minussign..SS "State file format"A state file has a line for each file in a tree. A line looks like thisformally for a simple file:.PP.RS.I "name mode owner group length date".RI [ link-number.RB [ last ]].RE.PPThe best way to show how each type of file is represented is by example:.PP.RS.nf.ta +10 +8 +4 +4 +6 +12 +4/ d755 0 0bin d755 2 0.in +2[ 644 2 0 233 759160857 1cat 755 2 0 3772 768742021test 755 2 0 233 759160857 1 last.in -2dev d755 0 0.in +2fd0 b666 0 0 200console c600 10 0 400sd2 b600 0 0 a02fifo p700 2 0.in -2opt -> usr/optusr ignore (Cross-device link).fi.RE.PPThe root of the tree is always represented by a /, no matter what type offile it may be. Directory entries of the root follow at the same level.Files in subdirectories are indented by two spaces. (Eight spaces arereplaced by a TAB.) Normal files have their length and modified time in thestate file, devices have their device number in hex, etc. If files are hardlinked to each other then they all get an extra "link number" to bind themtogether. The last link is marked with the word.BR last ..PPOne usually only modifies a state file to ignore differences between twofiles. One does this by replacing the file attributes with the word.BR ignore ..RB ( Remsyncgenerates this keyword too, with the reason why added in parentheses.).SH OPTIONS.TP.B \-sGenerate a state file..TP.B \-dGenerate a differences file. (The default is to apply a differences file.).TP.B \-uOnly add new files or update files with newer versions..TP.B \-xDo not cross device boundaries. This allows one to operate on the root filesystem for instance ignoring the.B /usrfile system..TP.B \-DDebug differences file generation. With this flag no file contents areadded to the differences file. The result is then human readable..TP.B \-vLists the commands added to the differences file, or the actions doneapplying a differences file. The output looks like \s-2UNIX\s+2 commandsexcept for the words "add", "restore" and "update" indicating addition of anew file, replacing a file with an older version, or replacement by a newerversion..SH EXAMPLESActions taken by the author to update his notebook "finiah" from his mainmachine "darask":.PP.RS.nffiniah# remsync -s /usr /tmp/finiah.state.SPEdit the state file to ignore .Xauthority files and /usr/var..SPfiniah# tar cvf /dev/fd0 /tmp/finiah.state.SPdarask# tar xvf /dev/fd0.brdarask# remsync -dv /usr /tmp/finiah.state | vol 1440 /dev/fd0.SPfiniah# vol 1440 /dev/fd0 | remsync -v /usr.fi.RE.PPOne could add a file compression/decompression program between.B remsyncand.BR vol ,to reduce the number of floppies to move about, but that actually slowsthings down! (Note that one only needs to shuffle two floppies about if thetwo machines are adjacent. To update a remote machine it does make sense touse compression to reduce the number of floppies to carry.).SH "SEE ALSO".BR synctree (1),.BR vol (1),.BR tar (1)..SH NOTESNothing stops you from using.B remsyncover a fast network of course..B Synctreecan be a bit tedious if you only want to ignore a few files. Editing astate file is then easier..SH BUGSFiles are overwritten, not removed, when they are updated. This meansthat links outside the tree are also updated. The less desirablealternative to this is to break the link before the update..PPThe verbose option may say that a link is to be created when making adifferences file. The link is often already there when the update takesplace, so no action is taken, and thus no talk about it. So you may miss afew mutterings about links if you compare the messages..SH AUTHORKees J. Bot (kjb@cs.vu.nl)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -