Thursday, September 10, 2009

The Jato IRC logger

Here's the recipe for the Jato IRC logger. Nothing fancy, but works surprisingly well.

/home/vegard/jato-irc-logger/irssi-config:
settings = {
core = {
real_name = "#jato IRC logger";
user_name = "vegard";
nick = "jato-irc-logger";
};

"fe-text" = {
actlist_sort = "refnum";
};

"fe-common/core" = {
autolog = "Yes";
autolog_path = "logs/$0/%Y-%m-%d.txt";
};
};

servers = (
{
address = "irc.freenode.net";
chatnet = "Freenode";
port = "6667";
autoconnect = "Yes";
},
);

chatnets = {
Freenode = {
type = "IRC";
autosendcmd = "/^msg nickserv identify vegard password";
};
};

channels = (
{
name = "#jato";
chatnet = "Freenode";
autojoin = "Yes";
},
);


/home/vegard/jato-irc-logger/screenrc:
screen irssi --config=irssi-config


/home/vegard/jato-irc-logger/start-logger.sh:
#! /bin/bash -e

screen -c screenrc -dmS jato-irc-logger


crontab:
# m h  dom mon dow   command
0 * * * * rsync -r -t --chmod=a+r jato-irc-logger/logs/#jato/ vegardno@hostname:www_docs/jato-irc-logs


/etc/rc.local:
#!/bin/sh -e

cd /home/vegard/jato-irc-logger
sudo -u vegard ./start-logger.sh &

exit 0

No comments: