Windows Client Quick Start
I've found an online reference that's very helpful when it comes to resolving specific errors. Take a look at this and let me know if it works for you!
Note that there have been some changes in the rsync solution landscape since this was originally written so I might want to evaluate Grsync as a useful rsync tool. (And rdiff-backup. And anything else interesting here.)
On Client; install cwRsync from here. Download cwRsync_<version>_Installer.zip then run the .exe program inside. To backup run something like this:
pushd C:\Documents and Settings\DaleM\Some folder to backup
rsync --modify-window=2 --chmod=u+rwx,g+rx,o+x --verbose --progress --stats --compress --recursive --relative --times --perms --links --delete . ravmud@MooreWorks.DynDNS.Org::bills/someBackup
To restore just turn the source and target around "ravmud@MooreWorks.DynDNS.Org::bills/thisBackup .". (Read the gotchas in this website about tuning for Windows.) Revise C:\Program Files\cwRsync\cwrsync.cmd to hold the correct command lines then schedule it to run in the Windows task scheduler. I use the pushd command line because the cygwin path references are odd, put yourself in the folder that needs backup (with "pushd C:\Folder") then just backup the current folder using "." on the command line.
rSync is a tool for copying folders and files from one place to another. You can copy from your local hard drive to a different location on your local hard drive. You can also copy from your local hard drive to another computer on your LAN or the Internet. The copy that happens can be very smart so that only the changed pieces of very large files is copied.
For more information about rSync read from the following list:
- http://en.wikipedia.org/wiki/Rsync is always a good place to start.
- http://www.rsync.net/ Main web site. Windows information here.
- http://samba.anu.edu.au/rsync/ SAMBA started the rSync project.
- http://www.gaztronics.net/rsync.php If you are a Linux SysAdmin looking for a way to Rsync a Windows machine to your Linux server, or you are a Windows user who wants to use Rsync as a Server, then you have come to the right place!
- http://everythinglinux.org/rsync/ Server and Client notes.
- http://transamrit.net/docs/rsync/ Linux server setup notes.
- http://sourceforge.net/projects/sereds/ SEREDS is a toolbox for secure distribution/replication of software/files on multiple platforms/systems. Perl, openssh and rsync are key components. More files here.
Please let us know of your experiences!
Create new backup repository for BobIsYourUncle and do a backup.
- On MooreWorks.DynDNS.Org:873 server "mkdir /mnt/sdb1/BobIsYourUncle"
- chown ravmud:ravmud /mnt/sdb1/BobIsYourUncle
- vi /etc/rsyncd.conf
path = /mnt/sdb1/BobIsYourUncle
comment = Moore Works rSync Server
uid = user1
gid = user1
read only = no
list = yes
auth users = ravmud
secrets file = /etc/rsyncd.secrets
- vi /etc/rsyncd.secrets
- On Client install cwRsync then run "rsync --verbose --progress --stats --compress --recursive --relative --times --perms --links --delete . user1@LocalHost::BobIsYourUncle/thisBackup"
- To restore just turn the source and target around "user1@LocalHost::BobIsYourUncle/thisBackup .".
Data flow analysis
To MooreWorks.DynDNS.Org:873 which port forwards to 192.168.1.98 PC Bubbles a 265.2 GB HD.
/etc/rsyncd.conf has repositories(?) definitions.
/etc/rsyncd.secrets has account access information.
Starts at 2 AM, ends about 2:15 everyday about 15 minutes for 15 MB.
/var/log/rsyncd.log is the recent activity log.
Notice that some log entries are GMT and others local time. It's 5 hours off GMT here in San Antonio, Texas.
2009/04/29 21:05:22  connect from adsl-70-248-12-38.dsl.snantx.swbell.net (18.104.22.168)
2009/04/30 02:05:23  rsync to SASmax/ from email@example.com (22.214.171.124)
2009/04/30 02:05:23  receiving file list
2009/04/30 02:05:31  MAX/DAT/
2009/04/30 02:18:49  sent 1073238 bytes received 15595250 bytes total size 13003962668
About 15 MB in 13 minutes.
/mnt/sdb1/SAS is 29.3 GB and is the SAS rsync backup target repository.
The data transfer is about 1 MB a minute.
rsync occasionally produces error messages that may seem a little cryptic.
The one that seems to cause the most confusion is "protocol version
mismatch - is your shell clean?". This message is usually caused by
your startup scripts or remote shell facility producing unwanted garbage
on the stream that rsync is using for its transport. The way to diagnose
this problem is to run your remote shell like this:
rsh remotehost /bin/true > out.dat then look at out.dat.
If everything is working correctly then out.dat should be a zero
length file. If you are getting the above error from rsync then you
will probably find that out.dat contains some text or data.
Look at the contents and try to work out what is producing it.
The most common cause is incorrectly configured shell startup scripts
(such as .cshrc or .profile) that contain output statements for
non-interactive logins. If you are having trouble debugging include
and exclude patterns, then try specifying the -vv option. At this level
of verbosity rsync will show why each individual file is included or
root@RyCycle:~/bin# rsync -vv 4rsync.sh ravmud@LakeNap::MWdale/rycycle/
opening tcp connection to LakeNap port 873
sending daemon args: --server -vve.Lsf . MWdale/rycycle/
Change is the firmament.
created directory /rycycle
total: matches=0 hash_hits=0 false_alarms=0 data=512
sent 581 bytes received 27 bytes 243.20 bytes/sec
total size is 512 speedup is 0.84
More Setup and Diagnostics here
, and here
Example Command Lines/Batch Files
pushd C:\Documents and Settings\Amy
echo rsync-ing "C:\Documents and Settings\Amy"
"C:\Program Files\cwRsync\bin\rsync" --chmod=u+rwx,g+rx,o+x --verbose --progress --stats --compress --recursive --relative --times --perms --links --password-file="p1" . firstname.lastname@example.org::AAMHA/AMY
call K:\Scripts\bu0.bat K:\Logs rsync2DaleM log K:\Logs
echo Look in %log% for results.
echo Backing up with rsync >%log%
%0 rsync-ing C:\Documents and Settings\Brucew\My Documents
pushd C:\Documents and Settings\Brucew\My Documents
echo rsync-ing "C:\Documents and Settings\Brucew\My Documents">>%log%
"C:\Program Files\cwRsync\bin\rsync">>%log% 2>&1 --verbose --progress --stats --compress --recursive --relative --times --perms --links --password-file="/cygdrive/c/Documents and Settings/Brucew/p1" . email@example.com::bruceREPO/mydocs/bruce
@Echo Begin: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
if %mwPath%.==. Set mwPath=S:
cscript %mwPath%\scripts\logit.vbs Begin: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
pushd "C:\Program Files\cwRsync\bin\"
"C:\Program Files\cwRsync\bin\rsync.exe" --verbose --progress --stats --compress --recursive --times --perms --links --exclude "*bak" --exclude "*~" --password-file="pass.txt" /cygdrive/r/ persyn@MooreWorks.DynDNS.Org::Persyn
cscript %mwPath%\scripts\logit.vbs End: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
@Echo End: %0 %1 %2 %3 %4 %5 %6 %7 %8 %9