I don’t use this anymore, but kept the instructions here for future reference
I installed some dependencies from MacPorts:
1 | port install librsync sqlite2 libtasn1 gnutls pkgconfig |
I then fetched the csync2 source and verified the hash:
1 | curl -O http://oss.linbit.com/csync2/csync2-1.34.tar.gz |
I found the 1.34 checksum to be:
1 | 32b250dd4a0353f71015c5c3961174b975dd5e799e4a084e8f6d00792bd8c833 csync2-1.34.tar.gz |
I then extracted the source code:
1 | tar -xvf csync2-1.34.tar.gz |
And patched it:
1 | curl -O http://www.johnko.ca/scripts/csync2-1.34-darwin.patch |
I ran configure
with some special options:
1 | ./configure --prefix=/opt/local --exec-prefix=/opt/local CC="gcc" CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib" LIBGNUTLS_CONFIG="/opt/local/bin/pkg-config gnutls" |
Then I ran make and make install:
1 | make |
I then created the keys:
1 | umask 077 |
Then modified the /etc/hosts
file to avoid DNS poisoning:
1 | echo 192.168.255.144 csyncbar >> /etc/hosts |
And configured my /etc/csync2.cfg
:
1 | group mygroup |
Make the folders
1 | install -d -o chill /data/chill/test |
Copy over my configuration and PSK:
1 | rsync -viatP /etc/csync2.key_* root@csyncbar:/etc/ |
Then still on my Mac, run the standalone server:
1 | csync2 -D ~/csync2/db -ii -v >~/csync2/server.log 2>&1 & |
On my FreeBSD machine it was much easier:
1 | pkg install -y csync2 rsync |
Daily usage
On FreeBSD, to hash and dry-run:
1 | csync2 -xdv |
On Mac, to sync files:
1 | csync2 -D ~/csync2/db -N chill -xv |
After making changes to /etc/csync2.cfg
on Mac:
On Mac:
1 | rsync -viatP /etc/csync2.key_* root@csyncbar:/etc/ |
On FreeBSD:
1 | /usr/local/etc/rc.d/csync2 restart |
And back on Mac:
1 | csync2 -D ~/csync2/db -N chill -xv |