Skip to content
Commandline PHP app to convert old irc://irc.freenode.net/hsbne logs to the current log format.
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
convertphp
logs-20130627.tgz
logs-old.tar

README.md

IRC Log Converter

Why

We log #HSBNE to file publically, as it states in our channel topic. At one point we had to migrate logging bots due to a member leaving. This script converts the old logs to the new logs.

The script is recorded here in case it's found in the future that some huge gaff has been made and data lost.

What

There are two log archives. the old is the files to be converted, and the dated archive is the latest logs from when the logging server was shut down.

Requirements

  • >= PHP5.3

Setup

tar -xf logs.tar logs

Usage

chmod +x convertphp
./convertphp

Implementation Notes

The script recurses for all files, then parses out the filename and each line of each file to find timestamp information and consequent info like username, action etc. It places this all into a big array and then writes it out. Ie its a functional piece of code, not an efficient piece of code.

If it's found to have lost any lines, then they weren't matched by $searches. Just add a new search regex and a matching result string to transform it to. If it's any more broken than that, you'll probably have to start from scratch cos this script won't help.

Something went wrong with that request. Please try again.