--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">Frequently Asked Questions</H2>
+
+<!--#include virtual="/rsync/faq.txt" -->
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<pre><small>
+<!--#include virtual="/ftp/rsync/COPYING" -->
+</small></pre>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<pre><small>
+<!--#include virtual="/ftp/rsync/README" -->
+</small></pre>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">rsync resources</H2>
+
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+#!/bin/sh
+
+# This script does personal backups to a rsync backup server. You will end up
+# with a 7 day rotating incremental backup. The incrementals will go
+# into subdirectories named after the day of the week, and the current
+# full backup goes into a directory called "current"
+# tridge@linuxcare.com
+
+# directory to backup
+BDIR=/home/$USER
+
+# excludes file - this contains a wildcard pattern per line of files to exclude
+EXCLUDES=$HOME/cron/excludes
+
+# the name of the backup machine
+BSERVER=owl
+
+# your password on the backup server
+export RSYNC_PASSWORD=XXXXXX
+
+
+########################################################################
+
+BACKUPDIR=`date +%A`
+OPTS="--force --ignore-errors --delete-excluded --exclude-from=$EXCLUDES
+ --delete --backup --backup-dir=/$BACKUPDIR -a"
+
+export PATH=$PATH:/bin:/usr/bin:/usr/local/bin
+
+# the following line clears the last weeks incremental directory
+[ -d $HOME/emptydir ] || mkdir $HOME/emptydir
+rsync --delete -a $HOME/emptydir/ $BSERVER::$USER/$BACKUPDIR/
+rmdir $HOME/emptydir
+
+# now the actual transfer
+rsync $OPTS $BDIR $BSERVER::$USER/current
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">Documentation</H2>
+
+
+<ul>
+
+<li> The <a href="/rsync/FAQ.html">FAQ</a>
+
+<li> The rsync <A HREF="README.html">README</A>
+
+<li> A html version of the original
+<A HREF="tech_report/">rsync technical report</A>
+
+<li> An html version of the <A HREF="/ftp/rsync/rsync.html">rsync man page</A>
+
+<li> An html version of the <A HREF="/ftp/rsync/rsyncd.conf.html">rsyncd.conf man page</A>
+
+<li> A copy of my PhD thesis, which includes three chapters on rsync,
+is available at <a
+href="http://samba.org/~tridge/">http://samba.org/~tridge/</a>
+
+<li> A <a href="/rsync/y2k.html">Y2K</A> statement
+
+</ul>
+
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+<!-- $Header$ -->
+
+<H2 align="center">rsync download</H2>
+
+You can download rsync via ftp, http, cvs or rsync.
+
+<H2>http</H2>
+
+<ul>
+<li>The source code is available <A HREF="/ftp/rsync/">here</A>
+
+<li>Binaries for a number of platforms are available
+ <A HREF="/ftp/rsync/binaries/">here</A>
+</ul>
+
+<H2>ftp</H2>
+
+<ul>
+<li>The source code is available <A HREF="ftp://rsync.samba.org/pub/rsync/">here</A>
+
+<li>Binaries for a number of platforms are available
+ <A HREF="ftp://rsync.samba.org/pub/rsync/binaries/">here</A>
+</ul>
+
+<H2>rsync</H2>
+
+<ul>
+<li>The rsync ftp site is available via anonymous rsync at <em>rsync://rsync.samba.org/rsyncftp/</em>
+<li>An unpacked copy of the latest development version can be obtained
+from <em>rsync://rsync.samba.org/ftp/unpacked/rsync/</em>
+</ul>
+
+<H2>cvs</H2>
+
+<ul>
+<li>Details on how to access the anonymous cvs archives on
+cvs.samba.org are available <A HREF="/cvs.html">here</A>
+</ul>
+
+<h2>Contributing binaries</h2>
+
+If you can build binaries for a platform that we currently don't offer
+binaries for then please let me know (via the bug tracking
+system). I'll then give you a way of uploading binaries to
+rsync.samba.org. Please only do this if you have the time to build and
+package binaries in a timely fashion for every rsync release.
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">rsync examples</H2>
+
+If you have an interesting example of how you use rsync then please
+submit it to the
+<A HREF="mailto:rsync-bugs@samba.org">rsync-bugs@samba.org</A>
+for inclusion on this page.
+
+<h2>backup to a central backup server with 7 day incremental</h2>
+
+<pre><small>
+<!--#include virtual="backup.txt" -->
+</small></pre>
+
+<H2>backup to a spare disk</H2>
+
+<pre><small>
+<!--#include virtual="horus.txt" -->
+</small></pre>
+
+<H2>mirroring vger CVS tree</H2>
+
+<pre><small>
+<!--#include virtual="vger.txt" -->
+</small></pre>
+
+<H2>automated backup at home</H2>
+
+<pre><small>
+<!--#include virtual="susan.txt" -->
+</small></pre>
+
+<H2>Fancy footwork with remote file lists</H2>
+
+<pre><small>
+One little known feature of rsync is the fact that when run over a
+remote shell (such as rsh or ssh) you can give any shell command as
+the remote file list. The shell command is expanded by your remote
+shell before rsync is called. For example, see if you can work out
+what this does:
+
+ rsync -avR remote:'`find /home -name "*.[ch]"`' /tmp/
+
+note that that is backquotes enclosed by quotes (some browsers don't
+show that correctly).
+</small></pre>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<table><tr><td>
+<a href="#1">HP compile</a><br>
+<a href="#2">Read-only file system</a><br>
+<a href="#3">copies every file</a><br>
+<a href="#4">is your shell clean</a><br>
+<a href="#5">memory usage</a><br>
+<a href="#6">out of memory</a><br>
+</td><td><ol>
+<a href="#7">rsync 2.4.3 with rsh</a><br>
+<a href="#8">rsync and cron</a><br>
+<a href="#9">rsync: Command not found</a><br>
+<a href="#10">spaces in filenames</a><br>
+<a href="#11">stderr & stdout</a><br>
+<a href="#12">subscribe</a><br>
+</td></tr></table>
+<h3><a name=1>HP compile</a></h3>
+<pre><small>
+For HPUX apparently you need to add the option -Ae to the CFLAGS. Edit
+the Makefile and change CFLAGS to:
+
+ CFLAGS=-Ae -O
+</small></pre><hr>
+<h3><a name=2>Read-only file system</a></h3>
+<pre><small>
+if you get "Read-only file system" as an error when sending to a rsync
+server then you probably forgot to set "read only = no" for that
+module.
+</small></pre><hr>
+<h3><a name=3>copies every file</a></h3>
+<pre><small>
+Some people occasionally report that rsync copies every file when they
+expect it to copy only a small subset. In most cases the explanation
+is that rsync is not in fact copying every file it is just trying
+to update file permissions or ownership and this is failing for some
+reason. rsync lists files with the -v option if it makes any change
+to the file, including minor changes such as group changes.
+
+If you think that rsync is erroneously copying every file then look
+at the stats produced with -v and see if rsync is really sending all
+the data.
+
+
+</small></pre><hr>
+<h3><a name=4>is your shell clean</a></h3>
+<pre><small>
+The "is your shell clean" message and the "protocol mismatch"\r
+message are usually caused by having some sort of program\r
+in your .cshrc, .profile, .bashrc or equivalent file that\r
+writes a message every time you connect. Data written\r
+in this way corrupts the rsync data stream. rsync detects this\r
+at startup and produces those error messages.\r
+\r
+A good way to test this is something like:\r
+\r
+ rsh remotemachine /bin/true > test.dat\r
+\r
+you should get a file called test.dat created of 0 length. If\r
+test.dat is not of zero length then your shell is not clean.\r
+Look at the contents of test.dat to see what was sent. Look\r
+at all the startup files on remotemachine to try and find the\r
+problem.\r
+\r
+\r
+</small></pre><hr>
+<h3><a name=5>memory usage</a></h3>
+<pre><small>
+yes, rsync uses a lot of memory. The majority of the memory is used to
+hole the list of files being transferred. This takes about 100 bytes
+per file, so if you are transferring 800,000 files then rsync will consume
+about 80M of memory. It will be higher if you use -H or --delete.
+
+To fix this requires a major rewrite of rsync. I do plan on doing that, but
+I don't know when I'll get to it.
+</small></pre><hr>
+<h3><a name=6>out of memory</a></h3>
+<pre><small>
+The usual reason for "out of memory" when running rsync is that you
+are transferring a _very_ large number of files. The size of the
+files doesn't matter, only the total number of files.
+
+As a rule of thumb you should expect rsync to consume about 100 bytes per
+file in the file list. This happens because rsync builds a internal
+file list structure containing all the vital details of each file.
+rsync needs to hold structure in memory because it is being constantly
+traversed.
+
+I do have a plan for how to rewrite rsync so that it consumes a fixed
+(small) amount of memory no matter how many files are transferred, but
+I haven't yet found a spare week of coding time to implement it!
+
+
+</small></pre><hr>
+<h3><a name=7>rsync 2.4.3 with rsh</a></h3>
+<pre><small>
+rsync 2.4.3 has a problem with some versions of rsh. The versions of rsh (such as the
+one on Solaris) that don't handle non-blocking IO will cause all sorts of errors,
+including "unexpected tag" "multiplexing overflow" etc.
+
+The fix is to either use an earlier version of rsync or use ssh instead of rsh
+or wait for rsync 2.4.4
+
+</small></pre><hr>
+<h3><a name=8>rsync and cron</a></h3>
+<pre><small>
+On some systems (notably SunOS4) cron supplies what looks like a
+socket to rsync, so rsync thinks that stdin is a socket. This means
+that if you start rsync with the --daemon switch from a cron job you
+end up rsync thiking it has been started from inetd. The fix is simple
+- just redirect stdin from /dev/null in your cron job.
+
+</small></pre><hr>
+<h3><a name=9>rsync: Command not found</a></h3>
+<pre><small>
+> rsync: Command not found\r
+\r
+This error is produced when the remote shell is unable to locate the rsync\r
+binary in your path. There are 3 possible solutions:\r
+\r
+1) install rsync in a "standard" location that is in your remote path. \r
+\r
+2) modify your .cshrc, .bashrc etc on the remote machine to include the path\r
+that rsync is in\r
+\r
+3) use the --rsync-path option to explicitly specify the path on the\r
+remote machine where rsync is installed\r
+\r
+You may echo find the command:\r
+\r
+ rsh samba 'echo $PATH'\r
+\r
+for determining what your remote path is.\r
+\r
+\r
+</small></pre><hr>
+<h3><a name=10>spaces in filenames</a></h3>
+<pre><small>
+Jim wrote:\r
+> This seems to imply rsync can't copy files with names containing\r
+> spaces. A couple quick greps through the man page suggests that\r
+> this limitation isn't mentioned.\r
+\r
+Short answer: rsync can handle filenames with spaces\r
+\r
+Long answer: \r
+\r
+rsync handles spaces just like any other unix command line application.\r
+Within the code spaces are treated just like any other character so\r
+a filename with a space is no different from a filename with any\r
+other character in it.\r
+\r
+The problem of spaces is in the argv processing done to interpret the\r
+command line. As with any other unix application you have to escape\r
+spaces in some way on the command line or they will be used to\r
+separate arguments. \r
+\r
+It is slightly trickier in rsync because rsync sends a command line\r
+to the remote system to launch the peer copy of rsync. The command\r
+line is interpreted by the remote shell and thus the spaces need\r
+to arrive on the remote system escaped so that the shell doesn't\r
+split such filenames into multiple arguments.\r
+\r
+For example:\r
+\r
+ rsync -av fjall:'a long filename' /tmp/\r
+\r
+won't work because the remote shell gets an unquoted filename. Instead\r
+you have to use:\r
+\r
+ rsync -av fjall:'"a long filename"' /tmp/\r
+\r
+or a similar construct (there are lots of varients that work).\r
+\r
+As long as you know that the remote filenames on the command line\r
+are interpreted by the remote shell then it all works fine. \r
+\r
+I should probably provide the above examples in the docs :-)\r
+\r
+Cheers, Andrew\r
+\r
+
+</small></pre><hr>
+<h3><a name=11>stderr & stdout</a></h3>
+<pre><small>
+> Why does rsync produce some things on stdout and some on stderr?\r
+\r
+All messages which originate from the remote computer are sent to stderr.\r
+All informational messages from the local computer are sent to stdout.\r
+All error messages from the local computer are sent to stderr.\r
+\r
+There is a reason to this system, and it would be quite difficult to change.\r
+The reason is that rsync uses a remote shell for execution. The remote\r
+shell provides stderr/stdout. The stdout stream is used for the rsync \r
+protocol. Mixing error messages into this stdout stream would involve\r
+lots of extra overhead and complexity in the protocol because each message\r
+would need to be escaped, which means non-messages would need to be encoded\r
+in some way. Instead rsync always sends remote messages to stderr. This means\r
+they appear on stderr at the local computer. rsync can't intercept them.\r
+\r
+If you have a problem with scripts or cron jobs that produce stderr then I\r
+suggest you use your shell to redirect stderr to stdout. For example you\r
+could do a cron line like this:\r
+\r
+0 0 * * * /usr/local/bin/rsync -avz /foobar /foo 2>&1 > logfile\r
+\r
+this would send both stderr and stdout to "logfile". The magic\r
+bit is the "2>&1" which says to redirect stderr to stdout.\r
+\r
+\r
+\r
+</small></pre><hr>
+<h3><a name=12>subscribe</a></h3>
+<pre><small>
+> How to subscribe to rsync mailing list?\r
+\r
+Send a email to listproc@samba.org with no subject and a\r
+body of "subscribe rsync Your Name"\r
+\r
+See http://lists.samba.org/ for more info.\r
+\r
+</small></pre><hr>
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">rsync features</H2>
+
+rsync is a file transfer program for Unix systems. rsync uses the
+"rsync algorithm" which provides a very fast method for bringing
+remote files into sync. It does this by sending just the differences
+in the files across the link, without requiring that both sets of
+files are present at one of the ends of the link beforehand. <p>
+
+Some features of rsync include
+
+<ul>
+<li> can update whole directory trees and filesystems
+<li> optionally preserves symbolic links, hard links, file ownership,
+permissions, devices and times
+<li> requires no special privilages to install
+<li> internal pipelining reduces latency for multiple files
+<li> can use rsh, ssh or direct sockets as the transport
+<li> supports <A HREF="http://sunsite.auc.dk/SunSITE/rsync/rsync-mirroring.html">anonymous rsync</A> which is ideal for mirroring
+</ul>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+</td>
+<td></td>
+</tr>
+
+ <TR ALIGN="center">
+ <TD COLSPAN="3"><BR><BR><BR><img src="/samba/images/bar1.gif" WIDTH="493" HEIGHT="26" BORDER="0" alt="=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=">
+
+<!-- Search Google -->
+<p>
+<FORM method=GET action=http://www.google.com/custom>
+<A HREF=http://www.google.com/search>
+<IMG SRC=http://www.google.com/logos/Logo_40wht.gif border=0
+ALT=Google align=middle></A>
+<INPUT TYPE=text name=q size=31 maxlength=255 value="rsync ">
+<INPUT type=submit name=sa VALUE="Google Search">
+<INPUT type=hidden name=cof
+VALUE="LW:470;L:http://samba.org/samba/images/samba_banner.gif;LH:60;AH:center;S:http://samba.org/;AWFID:c22a54d0b6585ad8;">
+<font face=arial,sans-serif size=-1><input type=hidden name=domains value="samba.org">
+<br><input type=radio name=sitesearch value="">Search WWW
+<input type=radio name=sitesearch checked
+value="samba.org">Search rsync web pages and list archives </font><br>
+</FORM>
+<!-- Search Google -->
+
+ </TD>
+ </TR>
+</TABLE>
+</BODY>
+</HTML>
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<TITLE>rsync</TITLE>
+</HEAD>
+<BODY BGCOLOR="#ffffff" TEXT="#000000" VLINK="#292555" LINK="#292555" ALINK="#cc0033">
+<TABLE BORDER=0 WIDTH="70%" ALIGN="CENTER">
+ <tr VALIGN="middle">
+ <td ALIGN="left">
+ <ul>
+ <li><font size="-1"><a href="/rsync/index.html">home</a></font>
+ <li><font size="-1"><a href="/rsync/resources.html">resources</a></font>
+ <li><font size="-1"><a href="/rsync/features.html">features</a></font>
+ <li><font size="-1"><a href="/rsync/examples.html">examples</a></font>
+ </ul>
+ </td>
+ <td align="center">
+ <a href="/rsync/index.html"><img src="/images/rsync.gif"
+ border="0" alt="rsync"></a>
+ </td>
+ <td align="left">
+ <ul>
+ <li><font size="-1"><a href="/cgi-bin/rsync">bug tracking</a></font>
+ <li><font size="-1"><a href="/rsync/download.html">download</a></font>
+ <li><font size="-1"><a href="/rsync/documentation.html">documentation</a></font>
+ <li><font size="-1"><a href="http://rsync.samba.org/cgi-bin/rsync.fom"><b>FAQ-O-Matic</b></a></font>
+ </ul>
+ </td>
+ </tr>
+
+ <TR ALIGN="center">
+ <TD COLSPAN="3"><BR>
+ <img src="/samba/images/bar1.gif" WIDTH="493" HEIGHT="26"
+ BORDER="0"
+ alt="=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=">
+ <br><br><br>
+ </TD>
+ </TR>
+
+<tr><td></td><TD ALIGN="left">
--- /dev/null
+I do local backups on several of my machines using rsync. I have an
+extra disk installed that can hold all the contents of the main
+disk. I then have a nightly cron job that backs up the main disk to
+the backup. This is the script I use on one of those machines.
+
+ #!/bin/sh
+
+ export PATH=/usr/local/bin:/usr/bin:/bin
+
+ LIST="rootfs usr data data2"
+
+ for d in $LIST; do
+ mount /backup/$d
+ rsync -ax --exclude fstab --delete /$d/ /backup/$d/
+ umount /backup/$d
+ done
+
+ DAY=`date "+%A"`
+
+ rsync -a --delete /usr/local/apache /data2/backups/$DAY
+ rsync -a --delete /data/solid /data2/backups/$DAY
+
+
+
+The first part does the backup on the spare disk. The second part
+backs up the critical parts to daily directories. I also backup the
+critical parts using a rsync over ssh to a remote machine.
+
--- /dev/null
+<!-- $Header$ -->
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">Welcome to the rsync web pages</H2>
+
+rsync is an <A HREF="http://www.opensource.org/">open source</A>
+utility that provides fast incremental file transfer. rsync is freely
+available under the <A HREF="/rsync/GPL.html">GNU General Public
+License</A>
+
+<H2>rsync 2.5.4</H2>
+
+The latest version of rsync is version 2.5.4.
+
+<p>This version includes the following changes:
+
+<pre>
+<!--#include virtual="/ftp/rsync/rsync-2.5.4-NEWS" -->
+</pre>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">rsync on NT</H2>
+
+<pre>
+From: "Mike McHenry" <mmchen@minn.net>
+Subject: Rsync 2.3.1 WinNT binaries and instructions available
+Date: Fri, 15 Oct 1999 02:53:30 +1000
+
+Hello all,
+
+I have created Windows NT binaries for rsync 2.3.1 and have decided to make
+them available for others to download. These binaries have been tested on
+Windows NT Server 4.0 SP5 and WILL run in daemon mode if you follow my
+instructions below. I make no guarantees about these binaries, they have
+however been working for me for weeks on several NT machines.
+
+Binaries at ftp://ftp.minn.net/usr/mmchen/
+
+Instructions for running in daemon mode:
+
+1. You will need two files, rsync.exe and cygwin1.dll. Place rsync.exe
+anywhere you like (I chose c:\program files\rsync\rsync.exe) and put
+cygwin1.dll in c:\winnt\system32
+
+2. You will need a program from the NT Server resource kit called
+srvany.exe. This program allows you to run any executable as a service. If
+you simply install the entire service pack it will be located in c:\ntreskit
+
+3. Create a service for rsync by typing the following:
+ instsrv Rsync "C:\ntreskit\srvany.exe"
+
+4. You should now have a new service called Rsync and you can verify by
+looking in Start->Control Panel->Services DON'T START IT YET!
+
+5. If you want to run rsync in daemon mode you will need a configuration
+file. Here is the one I use, call it rsyncd.conf and place it in the same
+directory as rsync (C:\Program files\rsync\rsyncd.conf)
+ use chroot = false
+ strict modes = false
+ hosts allow = *
+
+ [backup]
+ path = /
+ read only = yes
+ list = no
+
+This example configuration will make one big anonymous anonymous rsync area
+available, I use this to backup my NT machines from a central Unix machine.
+This configuration might not be ideal for you, change to suit your tastes.
+The first two lines are important for rsync to work on Windows NT however.
+
+6. You are going to need to hack some keys in the registry to make it work.
+Don't do this unless you are comfortable with the changes! Run regedit32 and
+add the following keys and values (quotation marks ARE IMPORTANT):
+ HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Rsync
+ Edit->Add Key-> Key Name: Paramaters
+ Edit->Add Value-> Value Name: AppDirectory Value: "C:\programfiles\rsync"
+ Edit->Add Value-> Value Name: Application Value: "C:\programfiles\rsync\rsync.exe"
+ Edit->Add Value-> Value Name: AppParamters Value: --config="C:\programfiles\rsync\rsyncd.conf" --daemon
+
+7. That's it, you should be able to start and stop the rsync service at will
+using the Services Control Panel. When running with the above configuration
+you should be able to test by attempting to telnet to port 873 from a remote
+machine.
+ telnet rsync.server.com 873 (replacing rsync.server.com with your own
+server's address)
+You should get a connection to the rsync daemon running on your NT box.
+
+8. If you have problems you are on your own, sorry, I have enough to do :) I
+would suggest triple-checking your spelling on EVERYTHING (filenames,
+configs, reg keys). If you have any comments or suggestions I would be happy
+to hear them at mmchen@minn.net.
+
+Mike McHenry
+ Systems Administrator
+ MinnNet Communications, Inc.
+</pre>
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+From: "Mike McHenry" <mmchen@minn.net>
+Subject: Rsync 2.3.1 WinNT binaries and instructions available
+Date: Fri, 15 Oct 1999 02:53:30 +1000
+
+
+Hello all,
+
+I have created Windows NT binaries for rsync 2.3.1 and have decided to make
+them available for others to download. These binaries have been tested on
+Windows NT Server 4.0 SP5 and WILL run in daemon mode if you follow my
+instructions below. I make no guarantees about these binaries, they have
+however been working for me for weeks on several NT machines.
+
+Binaries at ftp://ftp.minn.net/usr/mmchen/
+
+Instructions for running in daemon mode:
+
+1. You will need two files, rsync.exe and cygwin1.dll. Place rsync.exe
+anywhere you like (I chose c:\program files\rsync\rsync.exe) and put
+cygwin1.dll in c:\winnt\system32
+
+2. You will need a program from the NT Server resource kit called
+srvany.exe. This program allows you to run any executable as a service. If
+you simply install the entire service pack it will be located in c:\ntreskit
+
+3. Create a service for rsync by typing the following:
+ instsrv Rsync "C:\ntreskit\srvany.exe"
+
+4. You should now have a new service called Rsync and you can verify by
+looking in Start->Control Panel->Services DON'T START IT YET!
+
+5. If you want to run rsync in daemon mode you will need a configuration
+file. Here is the one I use, call it rsyncd.conf and place it in the same
+directory as rsync (C:\Program files\rsync\rsyncd.conf)
+ use chroot = false
+ strict modes = false
+ hosts allow = *
+
+ [backup]
+ path = /
+ read only = yes
+ list = no
+
+This example configuration will make one big anonymous anonymous rsync area
+available, I use this to backup my NT machines from a central Unix machine.
+This configuration might not be ideal for you, change to suit your tastes.
+The first two lines are important for rsync to work on Windows NT however.
+
+6. You are going to need to hack some keys in the registry to make it work.
+Don't do this unless you are comfortable with the changes! Run regedit32 and
+add the following keys and values (quotation marks ARE IMPORTANT):
+ HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Rsync
+ Edit->Add Key-> Key Name: Paramaters
+ Edit->Add Value-> Value Name: AppDirectory Value: "C:\programfiles\rsync"
+ Edit->Add Value-> Value Name: Application Value: "C:\programfiles\rsync\rsync.exe"
+ Edit->Add Value-> Value Name: AppParamters Value: --config="C:\programfiles\rsync\rsyncd.conf" --daemon
+
+7. That's it, you should be able to start and stop the rsync service at will
+using the Services Control Panel. When running with the above configuration
+you should be able to test by attempting to telnet to port 873 from a remote
+machine.
+ telnet rsync.server.com 873 (replacing rsync.server.com with your own
+server's address)
+You should get a connection to the rsync daemon running on your NT box.
+
+8. If you have problems you are on your own, sorry, I have enough to do :) I
+would suggest triple-checking your spelling on EVERYTHING (filenames,
+configs, reg keys). If you have any comments or suggestions I would be happy
+to hear them at mmchen@minn.net.
+
+Mike McHenry
+ Systems Administrator
+ MinnNet Communications, Inc.
+
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">rsync resources</H2>
+
+Please let me know if you have any rsync related documents to add to
+this list
+
+<ul>
+
+<li>Here is an <A HREF="/listproc/rsync">archive of the rsync mailing list</A>.
+
+<li>Here is <A HREF="/listproc/">how to subscribe to the rsync mailing
+list</A>.
+
+<li>You can <A HREF="/listproc/ghindex.html">search the mailing list
+archives on this machine</A>.
+
+<li>If you still don't know what rsync is then take a look at the <A HREF="ftp://rsync.samba.org/pub/rsync/README">README</A>.
+
+<li>Here is the <A HREF="/ftp/rsync/cvs.log">rsync change log through
+the latest release</A>.
+
+<li> Brian Elliott Finley has put together a great Linux install system based
+on rsync. You you read about it at <a href="http://thefinleys.com/SystemImager/">http://thefinleys.com/SystemImager/</a>
+
+<li> Karsten Thygesen has written a doc on how to setup <A HREF="http://sunsite.auc.dk/SunSITE/rsync/rsync-mirroring.html">anonymous rsync servers</A>
+
+<li> Jim Davis has written a doc on how to <A
+HREF="http://www.cs.arizona.edu/people/jdavis/cfengine.html">setup
+cfengine to use rsync</A>
+
+<li> Anthony Wesley has written a doc on how to build <A HREF="ftp://rsync.samba.org/pub/rsync/win95.txt">rsync for Windows95</A>
+
+<li> Mike McHenry has written up come info on how to get <a
+href="nt.html">rsync working under NT</a>
+
+<li> Thomas Roessler has written a rsync wrapper for efficient, safe
+CVS mirroring. See <A HREF="ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/">ftp://riemann.iam.uni-bonn.de/pub/users/roessler/cvslock/</A>
+
+<li><a href="mailto:LEakin@Nostrum.COM">Lee Eakin</a> has written a <a href="rsync_wrapper.pl">perl wrapper for rsync</a>.
+
+<li>A <a href="http://www.srehttp.org/apps/rxrsync/">REXX implementation of rsync</a>!
+
+<li>Michael Holve has written a very useful <a
+href="http://everythinglinux.org/rsync/">rsync tutorial</a>
+
+</ul>
+
+
+
+<!--#include virtual="/rsync/footer.html" -->
--- /dev/null
+# __
+# /\ \ From the mind of
+# / \ \
+# / /\ \ \_____ Lee Eakin <LEakin@Nostrum.COM>
+# / \ \ \______\ or <Lee@Eakin.ORG>
+# / /\ \ \/____ /
+# \ \ \ \____\/ / Wrapper module for the rsync program
+# \ \ \/____ / rsync can be found at http://rsync.samba.org/rsync/
+# \ \____\/ /
+# \/______/
+
+package Rsync;
+require 5.004;
+
+use FileHandle;
+use IPC::Open3 qw(open3);
+use Carp;
+
+use strict;
+
+=head1 NAME
+
+Rsync - perl module interface to B<rsync> http://rsync.samba.org/rsync/
+
+=head1 SYNOPSIS
+
+use Rsync;
+
+$obj = Rsync->new(qw(-az C<-e> /usr/local/bin/ssh
+ --rsync-path /usr/local/bin/rsync));
+
+$obj->exec(qw(localdir rhost:remdir))
+ or warn "rsync failed\n";
+
+=head1 DESCRIPTION
+
+Perl Convenience wrapper for B<rsync> program. Written for B<rsync> 2.3.1 but
+should perform properly with most versions.
+
+=cut
+
+# options from the rsync man pae
+###### Boolean flags ######
+# -h, --help show this help screen
+# -v, --verbose increase verbosity
+# -q, --quiet decrease verbosity
+# -c, --checksum always checksum
+# -a, --archive archive mode
+# -r, --recursive recurse into directories
+# -R, --relative use relative path names
+# -b, --backup make backups (default ~ suffix)
+# -u, --update update only (don't overwrite newer files)
+# -l, --links preserve soft links
+# -L, --copy-links treat soft links like regular files
+# --copy-unsafe-links copy links outside the source tree
+# --safe-links ignore links outside the destination tree
+# -H, --hard-links preserve hard links
+# -p, --perms preserve permissions
+# -o, --owner preserve owner (root only)
+# -g, --group preserve group
+# -D, --devices preserve devices (root only)
+# -t, --times preserve times
+# -S, --sparse handle sparse files efficiently
+# -n, --dry-run show what would have been transferred
+# -W, --whole-file copy whole files, no incremental checks
+# -x, --one-file-system don't cross filesystem boundaries
+# -C, --cvs-exclude auto ignore files in the same way CVS does
+# RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS
+# .make.state .nse_depinfo *~ #* .#* ,* *.old *.bak
+# *.BAK *.orig *.rej .del-* *.a *.o *.obj *.so *.Z
+# *.elc *.ln core
+# --delete delete files that don't exist on the sending side
+# --delete-excluded also delete excluded files on the receiving side
+# --partial keep partially transferred files
+# --force force deletion of directories even if not empty
+# --numeric-ids don't map uid/gid values by user/group name
+# -I, --ignore-times don't exclude files that match length and time
+# --size-only only use file size when determining if a file
+# should be transferred
+# -z, --compress compress file data
+# --version print version number
+# --daemon run as a rsync daemon
+# --stats give some file transfer stats
+# --progress show progress during transfer
+###### scalar values ######
+# --csum-length=LENGTH <=16 bit md4 checksum size
+# -B, --block-size=SIZE checksum blocking size (default 700)
+# --timeout=TIME set IO timeout in seconds
+# --port=PORT specify alternate rsyncd port number
+# -e, --rsh=COMMAND specify rsh replacement
+# -T, --temp-dir=DIR create temporary files in directory DIR
+# --compare-dest=DIR also compare destination files relative to DIR
+# --exclude-from=FILE exclude patterns listed in FILE
+# --include-from=FILE don't exclude patterns listed in FILE
+# --config=FILE specify alternate rsyncd.conf file
+# --password-file=FILE get password from FILE
+# --log-format=FORMAT log file transfers using specified format
+# --suffix=SUFFIX override backup suffix
+# --rsync-path=PATH specify path to rsync on the remote machine
+###### array values ######
+# --exclude=PATTERN exclude files matching PATTERN
+# --include=PATTERN don't exclude files matching PATTERN
+#
+
+=over 4
+
+=item Rsync::new
+
+$obj = new Rsync;
+
+ or
+
+$obj = Rsync->new;
+
+ or
+
+$obj = Rsync->new(@options);
+
+=back
+
+Create an Rsync object. Any options passed at creation are stored in
+the object as defaults for all future exec call on that object. Options
+are the same as those in L<rsync> with the addition of
+--path-to-rsync which can be used to override the hardcoded default of
+/usr/local/bin/rsync, and --debug which causes the module functions to
+print some debugging information to STDERR.
+
+=cut
+
+sub new {
+ my $class=shift;
+
+ # seed the options hash, booleans, scalars, excludes, data,
+ # status, stderr/stdout storage for last exec
+ my $self={
+ # the full path name to the rsync binary
+ 'path-to-rsync' => '/usr/local/bin/rsync',
+ # these are the boolean flags to rsync, all default off, including them
+ # in the args list turns them on
+ 'flag' => {qw(
+ --archive 0 --backup 0 --checksum 0
+ --compress 0 --copy-links 0 --copy-unsafe-links 0
+ --cvs-exclude 0 --daemon 0 --delete 0
+ --delete-excluded 0 --devices 0 --dry-run 0
+ --force 0 --group 0 --hard-links 0
+ --help 0 --ignore-times 0 --links 0
+ --numeric-ids 0 --one-file-system 0 --owner 0
+ --partial 0 --perms 0 --progress 0
+ --quiet 0 --recursive 0 --relative 0
+ --safe-links 0 --size-only 0 --sparse 0
+ --stats 0 --times 0 --update 0
+ --verbose 0 --version 0 --whole-file 0
+ )},
+ # these have simple scalar args we cannot easily check
+ 'scalar' => {qw(
+ --block-size 0 --compare-dest 0 --config 0
+ --csum-length 0 --exclude-from 0 --include-from 0
+ --log-format 0 --password-file 0 --port 0
+ --rsh 0 --rsync-path 0 --suffix 0
+ --temp-dir 0 --timeout 0
+ )},
+ # these can be specified multiple times and are additive, the doc also
+ # specifies that it is an ordered list so we must preserve that order
+ 'exclude' => [],
+ # source/destination path names and hostnames
+ 'data' => [],
+ # return status from last exec
+ 'status' => 0,
+ 'realstatus' => 0,
+ # whether or not to print debug statements
+ 'debug' => 0,
+ # stderr from last exec in array format (messages from remote rsync proc)
+ 'err' => [],
+ # stdout from last exec in array format (messages from local rsync proc)
+ 'out' => [],
+ };
+ if (@_) {
+ &defopts($self,@_) or return undef;
+ }
+ bless $self, $class;
+}
+
+=over 4
+
+=item Rsync::defopts
+
+defopts $obj @options;
+
+ or
+
+$obj->defopts(@options);
+
+=back
+
+Set default options for future exec calls for the object. See L<rsync>
+for a complete list of valid options. This is really the internal
+function that B<new> calls but you can use it too. Presently there is no way
+to turn off the boolean options short of creating another object, but if it is
+needed and the B<rsync> guys don't use it, I may add hooks to let + and ++ or a
+leading no- toggle it back off similar to B<Getopt::Long> (the GNU way).
+
+=cut
+
+sub defopts {
+ my $self=shift;
+ my @opts=@_;
+
+ # need a conversion table in case someone uses the short options
+ my %short=(qw(
+ -B --block-size -C --cvs-exclude -D --devices -H --hard-links
+ -I --ignore-times -L --copy-links -R --relative -T --temp-dir
+ -W --whole-file -a --archive -b --backup -c --checksum
+ -e --rsh -g --group -h --help -l --links
+ -n --dry-run -o --owner -p --perms -q --quiet
+ -r --recursive -s --sparse -t --times -u --update
+ -v --verbose -x --one-file-system -z --compress
+ ));
+ while (my $opt=shift @opts) {
+ my $arg;
+ print(STDERR "setting debug flag\n"),$self->{debug}=1,next
+ if $opt eq '--debug';
+ print STDERR "processing option: $opt\n" if $self->{debug};
+ if ($opt=~/^-/) {
+ # handle short opts first
+ if ($opt=~/^-(\w+)$/) {
+ foreach (split '',$1) {
+ print STDERR "short option: -$_\n" if $self->{debug};
+ if (exists $short{'-'.$_}) {
+ $opt=$short{'-'.$_};
+ # convert it to the long form
+ $opt=$short{$opt} if exists $short{$opt};
+ # handle the 3 short opts that require args
+ $self->{scalar}{$opt}=shift(@opts),next if (/^[BeT]$/);
+ # handle the rest
+ $self->{flag}{$opt}=1,next if exists $self->{flag}{$opt};
+ }
+ carp "$opt - unknown option\n";
+ return undef;
+ }
+ }
+ # handle long opts with = args
+ if ($opt=~/^(--\w+[\w-]*)=(.*)$/) {
+ print STDERR "splitting longopt: $opt ($1 $2)\n" if $self->{debug};
+ ($opt,$arg)=($1,$2);
+ }
+ # handle boolean flags
+ $self->{flag}{$opt}=1,next if exists $self->{flag}{$opt};
+ # handle simple scalars
+ $self->{scalar}{$opt}=($arg || shift @opts),next
+ if exists $self->{scalar}{$opt};
+ # handle excludes
+ if ($opt eq '--exclude') {
+ $arg||=shift @opts;
+ # if they sent a reset, we will too
+ $self->{exclude}=[],next if $arg eq '!';
+ # otherwise add it to the list
+ push @{$self->{exclude}},$arg;
+ next;
+ }
+ # to preserve order we store both includes and excludes in the same
+ # array. We use the leading '+ ' (plus space) trick from the man
+ # page to accomplish this.
+ if ($opt eq '--include') {
+ $arg||=shift @opts;
+ # first check to see if this is really an exclude
+ push(@{$self->{exclude}},$arg),next if $arg=~s/^- //;
+ # next see if they sent a reset, if they did, we will too
+ $self->{exclude}=[],next if $arg eq '!';
+ # if it really is an include, fix it first, since we use exclude
+ $arg='+ '.$arg unless $arg=~/^\+ /;
+ push @{$self->{exclude}},$arg;
+ next;
+ }
+ # handle our special case to override hard-coded path to rsync
+ $self->{'path-to-rsync'}=($arg || shift @opts),next
+ if $opt eq '--path-to-rsync';
+ # if we get this far nothing matched so it must be an error
+ carp "$opt - unknown option\n";
+ return undef;
+ } else { # must be data (source/destination info)
+ print STDERR "adding to data array: $opt\n" if $self->{debug};
+ push(@{$self->{data}},$opt);
+ }
+ }
+ 1;
+}
+
+=over 4
+
+=item Rsunc::exec
+
+exec $obj @options or warn "rsync failed\n";
+
+ or
+
+$obj->exec(@options) or warn "rsync failed\n";
+
+=back
+
+This is the function that does the real work. Any options passed to this
+routine are appended to any pre-set options and are not saved. They effect
+the current execution of B<rsync> only. It returns 1 if the return status was
+zero (or true), if the B<rsync> return status was non-zero it returns undef and
+stores the return status. You can examine the return status from rsync and
+any output to stdout and stderr with the functions listed below.
+
+=cut
+
+sub exec {
+ my $self=shift;
+ my @cmd=($self->{'path-to-rsync'});
+
+ foreach (sort keys %{$self->{flag}}) {
+ push @cmd,$_ if $self->{flag}{$_};
+ }
+ foreach (sort keys %{$self->{scalar}}) {
+ push @cmd,$_.'='.$self->{scalar}{$_} if $self->{scalar}{$_};
+ }
+ foreach (@{$self->{exclude}}) {
+ push @cmd,'--exclude='.$_;
+ }
+ foreach (@{$self->{data}}) {
+ push @cmd,$_;
+ }
+ push @cmd,@_ if @_;
+ print STDERR "exec: @cmd\n" if $self->{debug};
+ my $in=FileHandle->new; my $out=FileHandle->new; my $err=FileHandle->new;
+ my $pid=eval{ open3 $in,$out,$err,@cmd };
+ if ($@) {
+ $self->{realstatus}=0;
+ $self->{status}=255;
+ $self->{err}=[$@,"Execution of rsync failed.\n"];
+ return undef;
+ }
+ $in->close; # we don't use it and neither should rsync (at least not yet)
+ $self->{err}=[ $err->getlines ];
+ $self->{out}=[ $out->getlines ];
+ $err->close;
+ $out->close;
+ waitpid $pid,0;
+ $self->{realstatus}=$?;
+ $self->{status}=$?>>8;
+ return undef if $self->{status};
+ return 1;
+}
+
+=over 4
+
+=item Rsync::status
+
+$rval = status $obj;
+
+ or
+
+$rval = $obj->status;
+
+=back
+
+Returns the status from last B<exec> call right shifted 8 bits.
+
+=cut
+
+sub status {
+ my $self=shift;
+ return $self->{status};
+}
+
+=over 4
+
+=item Rsync::realstatus
+
+$rval = realstatus $obj;
+
+ or
+
+$rval = $obj->realstatus;
+
+=back
+
+Returns the real status from last B<exec> call (not right shifted).
+
+=cut
+
+sub realstatus {
+ my $self=shift;
+ return $self->{realstatus};
+}
+
+=over 4
+
+=item Rsync::err
+
+$aref = err $obj;
+
+ or
+
+$aref = $obj->err;
+
+=back
+
+Returns an array or a reference to the array containing all output to stderr
+from the last B<exec> call. B<rsync> sends all messages from the remote
+B<rsync> process to stderr. This functions purpose is to make it easier for
+you to parse that output for appropriate information.
+
+=cut
+
+sub err {
+ my $self=shift;
+ return(wantarray ? @{$self->{err}} : $self->{err});
+}
+
+=over 4
+
+=item Rsync::out
+
+$aref = out $obj;
+
+ or
+
+$aref = $obj->out;
+
+=back
+
+Similar to the B<err> function, this returns an array or a reference to the
+array containing all output to stdout from the last B<exec> call. B<rsync>
+sends all messages from the local B<rsync> process to stdout.
+
+=cut
+
+sub out {
+ my $self=shift;
+ return(wantarray ? @{$self->{out}} : $self->{out});
+}
+
+=head1 Author
+
+Lee Eakin E<lt>leakin@nostrum.comE<gt>
+
+=head1 Credits
+
+Gerard Hickey C<PGP::Pipe>
+
+Russ Allbery C<PGP::Sign>
+
+Graham Barr C<Net::*>
+
+Andrew Tridgell and Paul Mackerras C<rsync(1)>
+
+John Steele E<lt>steele@nostrum.comE<gt>
+
+Philip Kizer E<lt>pckizer@nostrum.comE<gt>
+
+Larry Wall C<perl(1)>
+
+I borrowed many clues on wrapping an external program from the PGP modules,
+and I would not have had such a useful tool to wrap except for the great work
+of the B<rsync> authors. Thanks also to Graham Barr, the author of the libnet
+modules and many others, for looking over this code. Of course I must mention
+the other half of my brain, John Steele, and his good friend Philip Kizer for
+finding B<rsync> and bringing it to my attention. And I would not have been
+able to enjoy writing useful tools if not for the creator of the B<perl>
+language.
+
+=head1 Copyrights
+
+ Copyleft (l) 1999, by Lee Eakin
+
+=cut
+
+1;
--- /dev/null
+I use rsync to backup my wifes home directory across a modem link each
+night. The cron job looks like this
+
+ #!/bin/sh
+ cd ~susan
+ {
+ echo
+ date
+ dest=~/backup/`date +%A`
+ mkdir $dest.new
+ find . -xdev -type f \( -mtime 0 -or -mtime 1 \) -exec cp -aPv "{}"
+ $dest.new \;
+ cnt=`find $dest.new -type f | wc -l`
+ if [ $cnt -gt 0 ]; then
+ rm -rf $dest
+ mv $dest.new $dest
+ fi
+ rm -rf $dest.new
+ rsync -Cavze ssh . samba:backup
+ } >> ~/backup/backup.log 2>&1
+
+
+note that most of this script isn't anything to do with rsync, it just
+creates a daily backup of Susans work in a ~susan/backup/ directory so
+she can retrieve any version from the last week. The last line does
+the rsync of her directory across the modem link to the host
+samba. Note that I am using the -C option which allows me to add
+entries to .cvsignore for stuff that doesn't need to be backed up.
+
+
+
--- /dev/null
+The vger.rutgers.edu cvs tree is mirrored onto cvs.samba.org via
+anonymous rsync using the following script.
+
+ #!/bin/bash
+
+ cd /var/www/cvs/vger/
+ PATH=/usr/local/bin:/usr/freeware/bin:/usr/bin:/bin
+
+ RUN=`lps x | grep rsync | grep -v grep | wc -l`
+ if [ "$RUN" -gt 0 ]; then
+ echo already running
+ exit 1
+ fi
+
+ rsync -az vger.rutgers.edu::cvs/CVSROOT/ChangeLog $HOME/ChangeLog
+
+ sum1=`sum $HOME/ChangeLog`
+ sum2=`sum /var/www/cvs/vger/CVSROOT/ChangeLog`
+
+ if [ "$sum1" = "$sum2" ]; then
+ echo nothing to do
+ exit 0
+ fi
+
+ rsync -az --delete --force vger.rutgers.edu::cvs/ /var/www/cvs/vger/
+ exit 0
+
+Note in particular the initial rsync of the ChangeLog to determine if
+anything has changed. This could be omitted but it would mean that the
+rsyncd on vger would have to build a complete listing of the cvs area
+at each run. As most of the time nothing will have changed I wanted to
+save the time on vger by only doing a full rsync if the ChangeLog has
+changed. This helped quite a lot because vger is low on memory and
+generally quite heavily loaded, so doing a listing on such a large
+tree every hour would have been excessive.
--- /dev/null
+<!--#include virtual="/rsync/header.html" -->
+
+<H2 align="center">Year 2000 Issues</H2>
+
+We are starting to get a lot of Y2K compliance questions. The answer
+is that rsync has no Y2K problems. rsync uses 32 bit "seconds since
+1970" date formats and thus has no problems with the turn of the
+century.<p>
+
+You must remember though that rsync is part of a larger system. It
+relies on a transport mechanism (rsh, ssh etc) and many operating
+systems services (such as inetd, syslog etc). If any of these other
+parts fail then rsync will of course be affected.<p>
+
+Also remember that rsync comes with absolutely no warranty. It is up
+to you to test whether rsync is suitable in your computing environment,
+both before and after the turn of the century.
+
+<!--#include virtual="/rsync/footer.html" -->