/***************************************************************************
 *            README
 *
 *  Fri Oct 24 11:30:57 2003
 *  Copyright  2003  Phil Kett
 *  pkett@genesis-midi.com
 ****************************************************************************/


Readme for remosync

Compilation

./configure
make
make install

The usual configure options can be specified. 

Remsync has been tested on Linux (SuSE 8.2) and Solaris (2.6, 9) - it should compile on 
other *nix operating systems but I haven't been able to test it. 

Configuration

The default configuration file (specified in remsync.h) is /etc/remosync.cf, change the entry 
in remsync.h to match your system.

Sample config file

**CUT HERE**
server=no
port=1025
hostname=test.your.domain
ip_list=192.168.0.0/24,172.16.0.1
source=/tmp
destination=/temp
notify=/tmp
**CUT HERE**

Most of the options should be self explanatory, the ip_list option should contain a comma
seperated list of IP addresses or network addresses in / format (as indicated above). Do 
not put hostnames in this line.

Command line options

-h 						print help
-H						hostname of server
-p 						port (either the port to run the server on or the port on the remote 
							machine to connect to
-c						config file - use to specify an alternative config file
-i							comma seperated list of ip addresses / network addresses to accept
							connections from when running as a server
-s						Source Directory
-d						Destination Directory
-S						Start server
-n						Notification Directory (used for realtime monitoring)
-m 						Start realtime monitoring on source directory

Options are read in the following order

Default config
Specified config (-c option)
Other command line options

Command line options will always override both configuration files


Examples

remsync -S -p 1025 -i 192.168.1.1	

run server on port 1025, only accepting connections from IP address 192.168.1.1

remsync -p 1025 -H foo -s /test

Run a client process connecting to port 1025 on machine foo, the source directory is /test, 
as the destination directory hasn't been specified it will default to being the same as the 
source directory

remsync -s /test -d /test1

run locally, copying data from /test to /test1

A note on the realtime monitoring feature

This feature is only available when running on Linux and uses the dnotify kernel module.
When using realtime monitoring it is especially important that both the server and client are
configured with the same source and destination directories. This is because some filename
modifications are performed on both the server and the client that rely on these directories.

Realtime monitoring will copy files when they are changed or created and delete files when 
they are deleted from the source directory. These changes are all reflected in the destination
directory on the server machine.

The processing is designed with running remosync as a realtime monitor on one machine and 
pulling files off another machine using the normal directory scan method.

For example, if you have a solaris machine and a Linux machine, the linux machine can be
setup with realtime monitoring, if the solaris machine is running the server portion of remosync
the linux box can also periodically run a directory scan to pull any modified files off the solaris box. 
In this way both machines are kept up to date.

Unfortunately, the files created by the directory scan are also picked up by the realtime monitor.
As these files have just been pulled from the server we don't want to push them out again, 
that's why the notification switch (-n) is there, when using this switch a temporary file is created
(in whatever directory is specified in the command line or in the config file) to indicate that the 
file is being pulled off the server by remosync itself. The realtime monitor checks this directory
and won't push out any  files that it finds here, once it's checked the file it deletes the temporary
file to make sure that the next time the file changes it's copied out correctly.

The following shows the recommended command lines to run this system.

Server

remosync -S -s /data -d /data1 

Realtime monitor

remosync -s /data -d /data1 -H server -n /tmp/ 

Directory scan

remosync -s /data1 -d /data -H server -n /tmp

Note that the source and data directories are reversed when running the directory scan, this
is because you're pulling files off the server (reverse of the realtime monitor).

Some things to be aware of :-

If you have a very large directory you're going to need a very large machine! The system 
spawns a subprocess for each and every subdirectory that it comes across. This is to get 
around the kernel imposed limit on open file handles (1024 in the current kernel). The realtime 
monitor has to open three file handles on each directory that it finds. 

I've run this process on a directory that has nearly 3000 subdirectories without too many 
problems.

Deleting directories doesn't work very well at the moment, the system will only delete a directory
on the server machine if it's empty (I'll fix this in the next release)


Finally, if you come across any bugs or have any suggestions for features that remosync 
currently doesn't have then please email them to me at pkett@genesis-midi.com


Thanks

Phil Kett
