Archive for September 4th, 2009

Automatically clean Purple (Pidgin, Finch) logs

If you, like me, log all of your IM conversations; if you, like me, use Pidgin or another client based on libpurple; if you, like me, have friends that often change their status line, generating useless log lines as

foo changed status from Busy to Busy @ whatever

If you think, as well as me, that 150 MB of logs are way too much; well this is the script for you.

Purple Logs Cleaner aims at removing redundant entries from system logs in textual format. It looks for the .system folders of all your Pidgin/Finch accounts and automatically removes lines according to some customizable patterns. By now, it removes lines in the form “… changed status from … to …”, where the starting and the final status are the same (both in the English and in the Italian translated version “… ha cambiato stato da … a …”); you can hack the sed line at will, but please send me patches 😉 . The script will not touch any other file and it won’t run (obviously) if Pidgin is active.

Back to the numbers: after sixteen minutes of cleaning (kinda slow, because I had to scan for both English and Italian patterns, as I had some problems with intltool in the past), my ~/.purple/logs directory size decreased from 159 MB to only 58 MB! But, more importantly, the .system subdirectories, whose content is the only one touched by the script, decreased from an aggregated size of 143 MB to approximately 40 MB, that is the removal of the 72% of the original content! Subsequent invocations are much faster, under ten minutes, because much of the cruft has already been removed.

Ok, this is enough 🙂 You can download the script HERE !

Comments are welcome 😉

Add comment September 4th, 2009


Rate:  

Calendar

September 2009
M T W T F S S
« Aug   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

Badges

Posts by Month

Posts by Category

What's played in the cave