Init script for rsyncd.

Saturday, September 3rd, 2005

Ed: another one that was sitting in “drafts” for months.

#!/bin/bash
#
# Startup script for rsyncd.
#
# chkconfig: 345 86 16
# description: rsync rocks.
#

case “$1″ in
start)
echo “Starting rsyncd…”
/opt/rsync/bin/rsync –daemon –ipv4
;;
stop)
echo “Stopping rsyncd…”
killall /opt/rsync/bin/rsync
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo “Usage: $0 {start|stop|restart}”
exit 1
;;
esac

exit 0

Unison to keep files synced.

Thursday, March 3rd, 2005

I saw this article on Linux Journal and decided that I had to check it out; especially since installing unison for Mandrake is as easy as urpmi unison.

I had been using rsync to keep certain local and remote directories in sync, but I found that I would have to always remember which had the most recent data so I didn’t clobber my files; unison seems to do a far better job of merging conflicts.

My first test was to sync my IRC logs from #nblug:

unison .gaim/logs/irc/augie@irc.nblug.org/ ssh://linux/.gaim/logs/irc/augie@irc.nblug.org/

Success!

Now for the same thing but with less typing (over the long term); I create a file called irc.nblug.prf under the .unison directory like so:

root = .gaim/logs/irc/augie@irc.nblug.org/
root = ssh://linux/.gaim/logs/irc/augie@irc.nblug.org/

Now when I want to synch the two directories up it is as simple as unison irc.nblug .