csync2 on centos 5

great article on csync2 for centos

http://packetcloud.net/2009/08/28/compiling-csync2-on-centos-5/

another article: http://blog.rackcorp.com/?p=15

Csync2 because it allows bi-directional –delete.

Here are the steps

# cd /usr/local/src
# yum install cvs
# cvs -d :pserver:anonymous@www.sqlite.org:/sqlite login ---- use password "anonymous"
# cvs -d :pserver:anonymous@www.sqlite.org:/sqlite checkout sqlite
# cd sqlite
# cvs update -r version_2
# ./configure && make
# cd /usr/local/src
# tar -czvf sqlite.tgz sqlite --- make a tarball for static compile by csync2
# wget http://oss.linbit.com/csync2/csync2-1.34.tar.gz
# tar -zxvf csync2-1.34.tar.gz
# yum install librsync librsync-devel libtasn1-devel libtasn1 sqlite-devel sqlite bison bison-devel bison-runtime flex
# ./configure --with-libsqlite-source=../sqlite.tgz
# make && make install && make cert

Then edit /etc/services and add xinetd.d config.


add this to /etc/services:
csync2 30865/tcp # Csync2
where it is needed

# cd /etc/xinetd.d
# cp cvs csync2

edit csync2:
service csync2
{
disable = no
port = 30865
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/local/sbin/csync2
server_args = csync2 -i
}

Then change your /etc/csync2.cfg


group mygroup
{
host www1.___.com www2.___.com;
key /etc/csync2.key;
include /var/www/members/static/pictures/caches;
include /www/include;
include /www/config;
include /whatever/other/folder;

action
{
logfile "/var/log/csync2_action.log";
lo-local;
}

backup-directory /var/backups/csync2;
backup-generations 3;

auto none;
}

Generate the csync2 preshared key

# csync2 -k /etc/csync2.key